[Linux manuál]
Návod, kniha: POSIX Programmer's Manual
int posix_typed_mem_open(const char * name, int
oflag, int tflag);
posix_typed_mem_open: otevřít zadaný objekt paměti (POKROČILÝ REÁLNÝ ČAS)
Originální popis anglicky: posix_typed_mem_open - open a typed memory object ( ADVANCED REALTIME)Návod, kniha: POSIX Programmer's Manual
STRUČNĚ
#include <sys/mman.h>POPIS / INSTRUKCE
The posix_typed_mem_open() function shall establish a connection between the typed memory object specified by the string pointed to by name and a file descriptor. It shall create an open file description that refers to the typed memory object and a file descriptor that refers to that open file description. The file descriptor is used by other functions to refer to that typed memory object. It is unspecified whether the name appears in the file system and is visible to other functions that take pathnames as arguments. The name argument shall conform to the construction rules for a pathname. If name begins with the slash character, then processes calling posix_typed_mem_open() with the same value of name shall refer to the same typed memory object. If name does not begin with the slash character, the effect is implementation-defined. The interpretation of slash characters other than the leading slash character in name is implementation-defined. Each typed memory object supported in a system shall be identified by a name which specifies not only its associated typed memory pool, but also the path or port by which it is accessed. That is, the same typed memory pool accessed via several different ports shall have several different corresponding names. The binding between names and typed memory objects is established in an implementation-defined manner. Unlike shared memory objects, there is no way within IEEE Std 1003.1-2001 for a program to create a typed memory object. The value of tflag shall determine how the typed memory object behaves when subsequently mapped by calls to mmap(). At most, one of the following flags defined in <sys/mman.h> may be specified:- POSIX_TYPED_MEM_ALLOCATE
- Allocate on mmap().
- POSIX_TYPED_MEM_ALLOCATE_CONTIG
- Allocate contiguously on mmap().
- POSIX_TYPED_MEM_MAP_ALLOCATABLE
- Map on mmap(), without affecting allocatability.
- O_RDONLY
- Open for read access only.
- O_WRONLY
- Open for write access only.
- O_RDWR
- Open for read or write access.
NÁVRATOVÁ HODNOTA
Upon successful completion, the posix_typed_mem_open() function shall return a non-negative integer representing the lowest numbered unused file descriptor. Otherwise, it shall return -1 and set errno to indicate the error.CHYBY / ERRORY
The posix_typed_mem_open() function shall fail if:- EACCES
- The typed memory object exists and the permissions specified by oflag are denied.
- EINTR
- The posix_typed_mem_open() operation was interrupted by a signal.
- EINVAL
- The flags specified in tflag are invalid (more than one of POSIX_TYPED_MEM_ALLOCATE, POSIX_TYPED_MEM_ALLOCATE_CONTIG, or POSIX_TYPED_MEM_MAP_ALLOCATABLE is specified).
- EMFILE
- Too many file descriptors are currently in use by this process.
- ENAMETOOLONG
- The length of the name argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
- ENFILE
- Too many file descriptors are currently open in the system.
- ENOENT
- The named typed memory object does not exist.
- EPERM
- The caller lacks the appropriate privilege to specify the
flag POSIX_TYPED_MEM_MAP_ALLOCATABLE in argument tflag.
PŘÍKLADY POUŽITÍ
None.APPLICATION USAGE
None.RATIONALE
None.FUTURE DIRECTIONS
None.SOUVISEJÍCÍ
close() , dup() , exec() , fcntl() , fstat() , ftruncate() , mmap() , msync() , posix_mem_offset() , posix_typed_mem_get_info() , umask() , the Base Definitions volume of IEEE Std 1003.1-2001, <fcntl.h>, <sys/mman.h>COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .| 2003 | IEEE/The Open Group |