Loading...
Searching...
No Matches
Portability Routines
Apache Portability Runtime library
Collaboration diagram for Portability Routines:

## Modules

| Thread portability Routines
| DSO (Dynamic Loading) Portability Routines

## Data Structures

struct | apr_os_proc_mutex_t
struct | apr_os_sock_info_t

## Macros

#define | apr_os_global_mutex_t apr_os_proc_mutex_t
#define | apr_os_global_mutex_get apr_os_proc_mutex_get

## Typedefs

typedef int | apr_os_file_t
typedef DIR | apr_os_dir_t
typedef int | apr_os_sock_t
typedef struct apr_os_proc_mutex_t | apr_os_proc_mutex_t
typedef pid_t | apr_os_proc_t
typedef struct timeval | apr_os_imp_time_t
typedef struct tm | apr_os_exp_time_t
typedef void * | apr_os_dso_handle_t
typedef void * | apr_os_shm_t
typedef struct apr_os_sock_info_t | apr_os_sock_info_t
| alias for local OS socket

## Functions

apr_status_t | apr_os_file_get (apr_os_file_t *thefile, apr_file_t *file)
apr_status_t | apr_os_dir_get (apr_os_dir_t **thedir, apr_dir_t *dir)
apr_status_t | apr_os_sock_get (apr_os_sock_t *thesock, apr_socket_t *sock)
apr_status_t | apr_os_proc_mutex_get (apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex)
apr_status_t | apr_os_proc_mutex_get_ex (apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex, apr_lockmech_e *mech)
apr_status_t | apr_os_exp_time_get (apr_os_exp_time_t **ostime, apr_time_exp_t *aprtime)
apr_status_t | apr_os_imp_time_get (apr_os_imp_time_t **ostime, apr_time_t *aprtime)
apr_status_t | apr_os_shm_get (apr_os_shm_t *osshm, apr_shm_t *shm)
apr_status_t | apr_os_file_put (apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *cont)
apr_status_t | apr_os_pipe_put (apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont)
apr_status_t | apr_os_pipe_put_ex (apr_file_t **file, apr_os_file_t *thefile, int register_cleanup, apr_pool_t *cont)
apr_status_t | apr_os_dir_put (apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont)
apr_status_t | apr_os_sock_put (apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont)
apr_status_t | apr_os_sock_make (apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont)
apr_status_t | apr_os_proc_mutex_put (apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *cont)
apr_status_t | apr_os_proc_mutex_put_ex (apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_lockmech_e mech, int register_cleanup, apr_pool_t *cont)
apr_status_t | apr_os_imp_time_put (apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont)
apr_status_t | apr_os_exp_time_put (apr_time_exp_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont)
apr_status_t | apr_os_shm_put (apr_shm_t **shm, apr_os_shm_t *osshm, apr_pool_t *cont)
const char * | apr_os_default_encoding (apr_pool_t *pool)
const char * | apr_os_locale_encoding (apr_pool_t *pool)

## Detailed Description

## Macro Definition Documentation

## apr_os_global_mutex_get

#define apr_os_global_mutex_get apr_os_proc_mutex_get

Returns
  apr_os_global_mutex

## apr_os_global_mutex_t

#define apr_os_global_mutex_t apr_os_proc_mutex_t

Opaque global mutex type

## Typedef Documentation

## apr_os_dir_t

typedef DIR apr_os_dir_t

native dir

## apr_os_dso_handle_t

apr_os_dso_handle_t

native dso types

## apr_os_exp_time_t

typedef struct tm apr_os_exp_time_t

native tm

## apr_os_file_t

typedef int apr_os_file_t

native file

## apr_os_imp_time_t

typedef struct timeval apr_os_imp_time_t

native timeval

## apr_os_proc_mutex_t

typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t

native process mutex

## apr_os_proc_t

typedef pid_t apr_os_proc_t

native pid

## apr_os_shm_t

typedef void* apr_os_shm_t

native SHM

## apr_os_sock_t

typedef int apr_os_sock_t

native dir

## Function Documentation

## apr_os_default_encoding()

const char * apr_os_default_encoding | ( | apr_pool_t * | pool | ) |

Get the name of the system default character set.

Parameters

  pool | the pool to allocate the name from, if needed

## apr_os_dir_get()

apr_status_t apr_os_dir_get | ( | apr_os_dir_t ** | thedir,
|  | apr_dir_t * | dir
| ) |  |

convert the dir from apr type to os specific type.

Parameters

  thedir | The os specific dir we are converting to
  dir | The apr dir to convert.

## apr_os_dir_put()

apr_status_t apr_os_dir_put | ( | apr_dir_t ** | dir,
|  | apr_os_dir_t * | thedir,
|  | apr_pool_t * | cont
| ) |  |

convert the dir from os specific type to apr type.

Parameters

  dir | The apr dir we are converting to.
  thedir | The os specific dir to convert
  cont | The pool to use when creating to apr directory.

## apr_os_exp_time_get()

apr_status_t apr_os_exp_time_get | ( | apr_os_exp_time_t ** | ostime,
|  | apr_time_exp_t * | aprtime
| ) |  |

Get the exploded time in the platforms native format.

Parameters

  ostime | the native time format
  aprtime | the time to convert

## apr_os_exp_time_put()

apr_status_t apr_os_exp_time_put | ( | apr_time_exp_t * | aprtime,
|  | apr_os_exp_time_t ** | ostime,
|  | apr_pool_t * | cont
| ) |  |

Put the exploded time in the APR format.

Parameters

  aprtime | the APR time format
  ostime | the time to convert
  cont | the pool to use if necessary

## apr_os_file_get()

apr_status_t apr_os_file_get | ( | apr_os_file_t * | thefile,
|  | apr_file_t * | file
| ) |  |

convert the file from apr type to os specific type.

Parameters

  thefile | The os specific file we are converting to
  file | The apr file to convert.

Remarks
  On Unix, it is only possible to get a file descriptor from an apr file type.

## apr_os_file_put()

apr_status_t apr_os_file_put | ( | apr_file_t ** | file,
|  | apr_os_file_t * | thefile,
|  | apr_int32_t | flags,
|  | apr_pool_t * | cont
| ) |  |

convert the file from os specific type to apr type.

Parameters

  file | The apr file we are converting to.
  thefile | The os specific file to convert
  flags | The flags that were used to open this file.
  cont | The pool to use if it is needed.

Remarks
  On Unix, it is only possible to put a file descriptor into an apr file type.

## apr_os_imp_time_get()

apr_status_t apr_os_imp_time_get | ( | apr_os_imp_time_t ** | ostime,
|  | apr_time_t * | aprtime
| ) |  |

Get the imploded time in the platforms native format.

Parameters

  ostime | the native time format
  aprtime | the time to convert

## apr_os_imp_time_put()

apr_status_t apr_os_imp_time_put | ( | apr_time_t * | aprtime,
|  | apr_os_imp_time_t ** | ostime,
|  | apr_pool_t * | cont
| ) |  |

Put the imploded time in the APR format.

Parameters

  aprtime | the APR time format
  ostime | the time to convert
  cont | the pool to use if necessary

## apr_os_locale_encoding()

const char * apr_os_locale_encoding | ( | apr_pool_t * | pool | ) |

Get the name of the current locale character set.

Parameters

  pool | the pool to allocate the name from, if needed

Remarks
  Defers to apr_os_default_encoding() if the current locale's data can't be retrieved on this system.

## apr_os_pipe_put()

apr_status_t apr_os_pipe_put | ( | apr_file_t ** | file,
|  | apr_os_file_t * | thefile,
|  | apr_pool_t * | cont
| ) |  |

convert the file from os specific type to apr type.

Parameters

  file | The apr file we are converting to.
  thefile | The os specific pipe to convert
  cont | The pool to use if it is needed.

Remarks
  On Unix, it is only possible to put a file descriptor into an apr file type.

## apr_os_pipe_put_ex()

apr_status_t apr_os_pipe_put_ex | ( | apr_file_t ** | file,
|  | apr_os_file_t * | thefile,
|  | int | register_cleanup,
|  | apr_pool_t * | cont
| ) |  |

convert the file from os specific type to apr type.

Parameters

  file | The apr file we are converting to.
  thefile | The os specific pipe to convert
  register_cleanup | A cleanup will be registered on the apr_file_t to issue apr_file_close().
  cont | The pool to use if it is needed.

Remarks
  On Unix, it is only possible to put a file descriptor into an apr file type.

## apr_os_proc_mutex_get()

apr_status_t apr_os_proc_mutex_get | ( | apr_os_proc_mutex_t * | ospmutex,
|  | apr_proc_mutex_t * | pmutex
| ) |  |

Convert the proc mutex from apr type to os specific type

Parameters

  ospmutex | The os specific proc mutex we are converting to.
  pmutex | The apr proc mutex to convert.

## apr_os_proc_mutex_get_ex()

apr_status_t apr_os_proc_mutex_get_ex | ( | apr_os_proc_mutex_t * | ospmutex,
|  | apr_proc_mutex_t * | pmutex,
|  | apr_lockmech_e * | mech
| ) |  |

Convert the proc mutex from apr type to os specific type, also providing the mechanism used by the apr mutex.

Parameters

  ospmutex | The os specific proc mutex we are converting to.
  pmutex | The apr proc mutex to convert.
  mech | The mechanism used by the apr proc mutex (if not NULL).

Remarks
  Allows for disambiguation for platforms with multiple mechanisms available.

## apr_os_proc_mutex_put()

apr_status_t apr_os_proc_mutex_put | ( | apr_proc_mutex_t ** | pmutex,
|  | apr_os_proc_mutex_t * | ospmutex,
|  | apr_pool_t * | cont
| ) |  |

Convert the proc mutex from os specific type to apr type

Parameters

  pmutex | The apr proc mutex we are converting to.
  ospmutex | The os specific proc mutex to convert.
  cont | The pool to use if it is needed.

## apr_os_proc_mutex_put_ex()

apr_status_t apr_os_proc_mutex_put_ex | ( | apr_proc_mutex_t ** | pmutex,
|  | apr_os_proc_mutex_t * | ospmutex,
|  | apr_lockmech_e | mech,
|  | int | register_cleanup,
|  | apr_pool_t * | cont
| ) |  |

Convert the proc mutex from os specific type to apr type, using the specified mechanism.

Parameters

  pmutex | The apr proc mutex we are converting to.
  ospmutex | The os specific proc mutex to convert.
  mech | The apr mutex locking mechanism
  register_cleanup | Whether to destroy the os mutex with the apr one (either on explicit destroy or pool cleanup).
  cont | The pool to use if it is needed.

Remarks
  Allows for disambiguation for platforms with multiple mechanisms available.

## apr_os_shm_get()

apr_status_t apr_os_shm_get | ( | apr_os_shm_t * | osshm,
|  | apr_shm_t * | shm
| ) |  |

convert the shm from apr type to os specific type.

Parameters

  osshm | The os specific shm representation
  shm | The apr shm to convert.

## apr_os_shm_put()

apr_status_t apr_os_shm_put | ( | apr_shm_t ** | shm,
|  | apr_os_shm_t * | osshm,
|  | apr_pool_t * | cont
| ) |  |

convert the shared memory from os specific type to apr type.

Parameters

  shm | The apr shm representation of osshm
  osshm | The os specific shm identity
  cont | The pool to use if it is needed.

Remarks
  On fork()ed architectures, this is typically nothing more than the memory block mapped. On non-fork architectures, this is typically some internal handle to pass the mapping from process to process.

## apr_os_sock_get()

apr_status_t apr_os_sock_get | ( | apr_os_sock_t * | thesock,
|  | apr_socket_t * | sock
| ) |  |

Convert the socket from an apr type to an OS specific socket

Parameters

  thesock | The socket to convert.
  sock | The os specific equivalent of the apr socket..

## apr_os_sock_make()

apr_status_t apr_os_sock_make | ( | apr_socket_t ** | apr_sock,
|  | apr_os_sock_info_t * | os_sock_info,
|  | apr_pool_t * | cont
| ) |  |

Create a socket from an existing descriptor and local and remote socket addresses.

Parameters

  apr_sock | The new socket that has been set up
  os_sock_info | The os representation of the socket handle and other characteristics of the socket
  cont | The pool to use

Remarks
  If you only know the descriptor/handle or if it isn't really a true socket, use apr_os_sock_put() instead.

## apr_os_sock_put()

apr_status_t apr_os_sock_put | ( | apr_socket_t ** | sock,
|  | apr_os_sock_t * | thesock,
|  | apr_pool_t * | cont
| ) |  |

Convert a socket from the os specific type to the APR type. If sock points to NULL, a socket will be created from the pool provided. If **sock does not point to NULL, the structure pointed to by sock will be reused and updated with the given socket.

Parameters

  sock | The pool to use.
  thesock | The socket to convert to.
  cont | The socket we are converting to an apr type.

Remarks
  If it is a true socket, it is best to call apr_os_sock_make() and provide APR with more information about the socket.