os/ossrv/genericopenlibs/openenvcore/include/sys/ipc.dosc
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/** @file  ../include/sys/ipc.h
sl@0
     2
@internalComponent
sl@0
     3
*/
sl@0
     4
sl@0
     5
/** @fn  ftok(const char *pathname, int proj_id)
sl@0
     6
@param pathname
sl@0
     7
@param proj_id
sl@0
     8
@return   The ftok function will return -1 if pathname does not exist or if it cannot be accessed by the calling process.
sl@0
     9
On  success  the  generated key_t value is returned.
sl@0
    10
sl@0
    11
  The ftok function attempts to create a unique key suitable for use with the msgget , semget and shmget functions given the pathname of an existing file and a user-selectable id.
sl@0
    12
sl@0
    13
 The specified pathname must specify an existing file that is accessible to the calling process
sl@0
    14
or the call will fail.
sl@0
    15
Also, note that links to files will return the
sl@0
    16
same key, given the same id.
sl@0
    17
sl@0
    18
Examples:
sl@0
    19
@code
sl@0
    20
#include <sys/types.h>
sl@0
    21
#include <sys/ipc.h>
sl@0
    22
#include <stdio.h>
sl@0
    23
sl@0
    24
int main(void)
sl@0
    25
{
sl@0
    26
    char *pathame = "C:\XXX";
sl@0
    27
    int proj_id = 100;
sl@0
    28
    key_t fkey;
sl@0
    29
    if ((fkey = ftok(pathame, proj_id)) == -1) {
sl@0
    30
        printf("ftok() failed
sl@0
    31
");
sl@0
    32
    }
sl@0
    33
    return 0;
sl@0
    34
}
sl@0
    35
sl@0
    36
@endcode
sl@0
    37
@see semget()
sl@0
    38
@see shmget()
sl@0
    39
@see msgget()
sl@0
    40
sl@0
    41
sl@0
    42
sl@0
    43
@capability Deferred @ref RFs::Entry(const TDesC16&, TEntry&)
sl@0
    44
sl@0
    45
@publishedAll
sl@0
    46
@externallyDefinedApi
sl@0
    47
*/
sl@0
    48
sl@0
    49
sl@0
    50
/** @struct ipc_perm
sl@0
    51
sl@0
    52
To store information needed in determining  permissions  to  perform  an  ipc  operation.
sl@0
    53
sl@0
    54
@publishedAll
sl@0
    55
@externallyDefinedApi
sl@0
    56
*/
sl@0
    57
sl@0
    58
/** @var ipc_perm::cuid
sl@0
    59
creator user id
sl@0
    60
*/
sl@0
    61
sl@0
    62
/** @var ipc_perm::cgid
sl@0
    63
creator group id 
sl@0
    64
*/
sl@0
    65
sl@0
    66
/** @var ipc_perm::uid
sl@0
    67
user id
sl@0
    68
*/
sl@0
    69
sl@0
    70
/** @var ipc_perm::gid
sl@0
    71
group id 
sl@0
    72
*/
sl@0
    73
sl@0
    74
/** @var ipc_perm::mode
sl@0
    75
rw permission
sl@0
    76
*/
sl@0
    77
sl@0
    78
/** @var ipc_perm::seq
sl@0
    79
sequence X (to generate unique ipcid)
sl@0
    80
*/
sl@0
    81
sl@0
    82
/** @var ipc_perm::key
sl@0
    83
user specified msg or sem or shm key
sl@0
    84
*/
sl@0
    85
sl@0
    86
sl@0
    87
/** @def IPC_CREAT
sl@0
    88
sl@0
    89
SVID required constants (same values as system 5). create entry if key does not exist.
sl@0
    90
sl@0
    91
@publishedAll
sl@0
    92
@externallyDefinedApi
sl@0
    93
*/
sl@0
    94
sl@0
    95
/** @def IPC_EXCL
sl@0
    96
sl@0
    97
SVID required constants (same values as system 5). fail if key exists.
sl@0
    98
sl@0
    99
@publishedAll
sl@0
   100
@externallyDefinedApi
sl@0
   101
*/
sl@0
   102
sl@0
   103
/** @def IPC_NOWAIT
sl@0
   104
sl@0
   105
SVID required constants (same values as system 5). error if request must wait.
sl@0
   106
sl@0
   107
@publishedAll
sl@0
   108
@externallyDefinedApi
sl@0
   109
*/
sl@0
   110
sl@0
   111
/** @def IPC_PRIVATE	
sl@0
   112
sl@0
   113
private key 
sl@0
   114
sl@0
   115
@publishedAll
sl@0
   116
@externallyDefinedApi
sl@0
   117
*/
sl@0
   118
sl@0
   119
/** @def IPC_RMID
sl@0
   120
sl@0
   121
remove identifier
sl@0
   122
sl@0
   123
@publishedAll
sl@0
   124
@externallyDefinedApi
sl@0
   125
*/
sl@0
   126
sl@0
   127
/** @def IPC_SET
sl@0
   128
sl@0
   129
set options
sl@0
   130
sl@0
   131
@publishedAll
sl@0
   132
@externallyDefinedApi
sl@0
   133
*/
sl@0
   134
sl@0
   135
sl@0
   136
/** @def IPC_STAT
sl@0
   137
sl@0
   138
get options
sl@0
   139
sl@0
   140
@publishedAll
sl@0
   141
@externallyDefinedApi
sl@0
   142
*/
sl@0
   143
sl@0
   144
sl@0
   145
sl@0
   146
sl@0
   147
sl@0
   148
sl@0
   149
sl@0
   150
sl@0
   151
sl@0
   152
sl@0
   153
sl@0
   154
sl@0
   155