os/ossrv/genericopenlibs/openenvcore/include/unistd.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/unistd.h
sl@0
     2
@internalComponent
sl@0
     3
*/
sl@0
     4
sl@0
     5
/** @fn  access(const char *fn, int flags)
sl@0
     6
@param fn
sl@0
     7
@param flags
sl@0
     8
sl@0
     9
@return   Upon successful completion, the value 0 is returned; otherwise the
sl@0
    10
value -1 is returned and the global variable errno is set to indicate the
sl@0
    11
error.
sl@0
    12
sl@0
    13
  The access system calls check the accessibility of the file named in the fn argument for the access permissions indicated by the flags argument.
sl@0
    14
 The value of flags is either the bitwise-inclusive OR of the access permissions to be 
sl@0
    15
checked (R_OK for read permission, W_OK for write permission, and X_OK for execute/search permission), or the existence test ( F_OK. )
sl@0
    16
sl@0
    17
 For additional information on file access permissions see File Access Permissions.
sl@0
    18
sl@0
    19
Examples:
sl@0
    20
@code
sl@0
    21
/* Detailed description: This sample code checks read-ok accessibility of file Example.c
sl@0
    22
 *
sl@0
    23
 * Precondtions: Example.txt file should be present in working directory.
sl@0
    24
 */
sl@0
    25
#include <unistd.h>
sl@0
    26
int main()
sl@0
    27
{
sl@0
    28
  if(access("Example.c" ,R_OK)  < 0)  
sl@0
    29
  {
sl@0
    30
    printf("Read operation on the file is not permitted") ;
sl@0
    31
    return -1 ;
sl@0
    32
  }
sl@0
    33
  printf("Read operation permitted on Example.c file") ;
sl@0
    34
  return 0 ;
sl@0
    35
}
sl@0
    36
sl@0
    37
@endcode
sl@0
    38
 Output
sl@0
    39
@code
sl@0
    40
Read operation permitted on Example.c file
sl@0
    41
sl@0
    42
@endcode
sl@0
    43
sl@0
    44
Limitations:
sl@0
    45
sl@0
    46
The fn parameter should not exceed 256 characters in length. 
sl@0
    47
sl@0
    48
KErrNotReady of Symbian error code is mapped to ENOENT, which typically means drive
sl@0
    49
not found or filesystem not mounted on the drive.
sl@0
    50
sl@0
    51
@see chmod()
sl@0
    52
@see stat()
sl@0
    53
sl@0
    54
sl@0
    55
sl@0
    56
@capability Deferred @ref RFs::Entry(const TDesC16&, TEntry&)
sl@0
    57
sl@0
    58
@publishedAll
sl@0
    59
@externallyDefinedApi
sl@0
    60
*/
sl@0
    61
sl@0
    62
/** @fn  chdir(const char *_path)
sl@0
    63
@param _path
sl@0
    64
sl@0
    65
Note: This description also covers the following functions -
sl@0
    66
 fchdir() 
sl@0
    67
sl@0
    68
@return   Upon successful completion, the value 0 is returned; otherwise the
sl@0
    69
value -1 is returned and the global variable errno is set to indicate the
sl@0
    70
error.
sl@0
    71
sl@0
    72
  The path argument points to the pathname of a directory.
sl@0
    73
The chdir system call
sl@0
    74
causes the named directory
sl@0
    75
to become the current working directory, that is,
sl@0
    76
the starting point for path searches of pathnames not beginning with a slash, ‘/.’
sl@0
    77
sl@0
    78
 The fchdir system call causes the directory referenced by the file descriptor fd to become the current working directory, the starting point for path 
sl@0
    79
  searches of pathnames not beginning with a slash, ‘/.’
sl@0
    80
sl@0
    81
sl@0
    82
sl@0
    83
Examples:
sl@0
    84
@code
sl@0
    85
/*
sl@0
    86
 *  Detailed description   : This test code demonstrates usage of chdir system call
sl@0
    87
 *
sl@0
    88
 *  Preconditions : "Example" directory should be present in current working
sl@0
    89
   directory.
sl@0
    90
 */
sl@0
    91
#include <unistd.h>
sl@0
    92
int main()
sl@0
    93
{
sl@0
    94
  if(chdir("Example") < 0 )  
sl@0
    95
  {
sl@0
    96
     printf("Failed to change working directory");
sl@0
    97
     return -1 ;
sl@0
    98
  }
sl@0
    99
  printf("Working directory changed");
sl@0
   100
  return 0 ;
sl@0
   101
}
sl@0
   102
sl@0
   103
@endcode
sl@0
   104
 Output
sl@0
   105
@code
sl@0
   106
Working directory changed
sl@0
   107
sl@0
   108
@endcode
sl@0
   109
@code
sl@0
   110
#include<unistd.h>
sl@0
   111
#include<stdio.h>
sl@0
   112
int test_fchdir()
sl@0
   113
{
sl@0
   114
   int retVal;
sl@0
   115
   int rmdr;
sl@0
   116
   int mkdr = mkdir("test_dir", S_IWUSR);
sl@0
   117
   if( !mkdr )
sl@0
   118
   {
sl@0
   119
     int opn = open("test_dir", O_RDONLY);
sl@0
   120
     if( opn != -1 )
sl@0
   121
     {
sl@0
   122
       retVal = fchdir( opn );
sl@0
   123
       if( !retVal )
sl@0
   124
       {
sl@0
   125
         printf("Fchdir passed");
sl@0
   126
       }
sl@0
   127
       else
sl@0
   128
       {
sl@0
   129
         printf("Failed");
sl@0
   130
       }
sl@0
   131
       int cls = close(opn);
sl@0
   132
     }
sl@0
   133
     else
sl@0
   134
     {
sl@0
   135
       printf("Failed");
sl@0
   136
     }
sl@0
   137
     rmdr = rmdir("test_dir");  
sl@0
   138
   }
sl@0
   139
   else
sl@0
   140
   {
sl@0
   141
     printf("Failed");
sl@0
   142
   }
sl@0
   143
}
sl@0
   144
sl@0
   145
@endcode
sl@0
   146
 Output
sl@0
   147
@code
sl@0
   148
Fchdir passed
sl@0
   149
sl@0
   150
@endcode
sl@0
   151
sl@0
   152
Limitations:
sl@0
   153
sl@0
   154
The path parameter should not exceed 256 characters in length. 
sl@0
   155
KErrNotReady of Symbian error code is mapped to ENOENT, which typically means drive
sl@0
   156
not found or filesystem not mounted on the drive.
sl@0
   157
sl@0
   158
@capability Deferred @ref RFs::SetSessionPath(const TDesC16&)
sl@0
   159
@capability Deferred @ref RFs::Att(const TDesC16&, unsigned&)
sl@0
   160
sl@0
   161
@publishedAll
sl@0
   162
@externallyDefinedApi
sl@0
   163
*/
sl@0
   164
sl@0
   165
/** @fn  chown(const char *path, uid_t owner, gid_t group)
sl@0
   166
@param path
sl@0
   167
@param owner
sl@0
   168
@param group
sl@0
   169
sl@0
   170
Note: This description also covers the following functions -
sl@0
   171
 lchown() 
sl@0
   172
sl@0
   173
@return   These functions always return 0.
sl@0
   174
sl@0
   175
 
sl@0
   176
sl@0
   177
 The chown and lchown functions are build supported but not available functionally.
sl@0
   178
sl@0
   179
 Symbian OS does not support the concepts of multiple users and groups.
sl@0
   180
sl@0
   181
Limitations:
sl@0
   182
sl@0
   183
KErrNotReady of symbian error code is mapped to ENOENT, which typically means drive
sl@0
   184
not found or filesystem not mounted on the drive.
sl@0
   185
sl@0
   186
sl@0
   187
 
sl@0
   188
sl@0
   189
@publishedAll
sl@0
   190
@externallyDefinedApi
sl@0
   191
*/
sl@0
   192
sl@0
   193
/** @fn  close(int fd)
sl@0
   194
@param fd
sl@0
   195
@return   The close() function returns the value 0 if successful; otherwise it returns 
sl@0
   196
the value -1 and sets the global variable errno to indicate the error.
sl@0
   197
sl@0
   198
  The close system call deletes a descriptor from the per-process object reference 
sl@0
   199
table. If this is the last reference to the underlying object the object will 
sl@0
   200
be deactivated. For example, on the last close of a file the current seek pointer associated with the file is lost; on the last close of a socket any file descriptor for that file is closed by that process.
sl@0
   201
sl@0
   202
If 'fd' refers to a shared memory object that is still referenced at the last close, the 
sl@0
   203
contents of the memory object persists till it is unreferenced. 
sl@0
   204
If this is the last close of the shared memory object and the close results in unreferencing of the memory 
sl@0
   205
object and the memory object is unlinked, (only in this scenario) the memory object is removed.
sl@0
   206
sl@0
   207
 When a process exits all associated file descriptors are freed. As there is 
sl@0
   208
  a limit on active descriptors per processes the close system call is useful when a large quantity of file descriptors 
sl@0
   209
  are being handled.
sl@0
   210
sl@0
   211
sl@0
   212
sl@0
   213
Examples:
sl@0
   214
@code
sl@0
   215
/* Detailed description   : This test code demonstrates usage of close  system call
sl@0
   216
 *
sl@0
   217
 * Preconditions :  None.
sl@0
   218
 */
sl@0
   219
#include <stdio.h>
sl@0
   220
#include <unistd.h>
sl@0
   221
#include <sys/types.h>
sl@0
   222
#include <fcntl.h>
sl@0
   223
int main()
sl@0
   224
{
sl@0
   225
  int fd = 0;
sl@0
   226
  fd = open("Example.txt" , O_CREAT | O_RDWR , 0666);
sl@0
   227
  if(fd < 0 ) 
sl@0
   228
  {
sl@0
   229
    printf("Failed to open file Example.txt");
sl@0
   230
    return -1;
sl@0
   231
  }
sl@0
   232
 if(close(fd) < 0 )
sl@0
   233
 {
sl@0
   234
   printf("Failed to close  file Example.txt");
sl@0
   235
   return -1;
sl@0
   236
 }
sl@0
   237
 printf("File Example.txt closed" );
sl@0
   238
 return 0;
sl@0
   239
}
sl@0
   240
sl@0
   241
@endcode
sl@0
   242
 Output
sl@0
   243
@code
sl@0
   244
File Example.txt closed
sl@0
   245
sl@0
   246
@endcode
sl@0
   247
@see accept()
sl@0
   248
@see fcntl()
sl@0
   249
@see flock()
sl@0
   250
@see open()
sl@0
   251
@see pipe()
sl@0
   252
@see socket()
sl@0
   253
@see shm_open()
sl@0
   254
@see shm_unlink()
sl@0
   255
 
sl@0
   256
sl@0
   257
@publishedAll
sl@0
   258
@externallyDefinedApi
sl@0
   259
*/
sl@0
   260
sl@0
   261
/** @fn  dup(int aFid)
sl@0
   262
@param aFid
sl@0
   263
sl@0
   264
Note: This description also covers the following functions -
sl@0
   265
 dup2() 
sl@0
   266
sl@0
   267
@return   The value -1 is returned if an error occurs in either call.
sl@0
   268
The external variable errno indicates the cause of the error.
sl@0
   269
sl@0
   270
  The dup system call
sl@0
   271
duplicates an existing object descriptor and returns its value to
sl@0
   272
the calling process ( newd = dup (aFid, ).); The argument aFid is a small non-negative integer index in
sl@0
   273
the per-process descriptor table.
sl@0
   274
sl@0
   275
 The new descriptor returned by the call
sl@0
   276
is the lowest numbered descriptor
sl@0
   277
currently not in use by the process.
sl@0
   278
sl@0
   279
 The object referenced by the descriptor does not distinguish
sl@0
   280
between aFid and newd in any way.
sl@0
   281
Thus if newd and aFid are duplicate references to an open
sl@0
   282
file, read , write and lseek calls all move a single pointer into the file,
sl@0
   283
and append mode, non-blocking I/O and asynchronous I/O options
sl@0
   284
are shared between the references.
sl@0
   285
If a separate pointer into the file is desired, a different
sl@0
   286
object reference to the file must be obtained by issuing an
sl@0
   287
additional open system call.
sl@0
   288
sl@0
   289
 In dup2, the value of the new descriptor newd is specified.
sl@0
   290
If this descriptor is already in use and oldd != newd, the descriptor is first deallocated as if the close system call had been used.
sl@0
   291
If aFid is not a valid descriptor, then newd is not closed.
sl@0
   292
If aFid == newd and aFid is a valid descriptor, then dup2 is successful, and does nothing.
sl@0
   293
sl@0
   294
 Limitation: 
sl@0
   295
 
sl@0
   296
@code
sl@0
   297
dup2(int oldfd, int newfd); 
sl@0
   298
@endcode
sl@0
   299
The return value of dup2 can be different 
sl@0
   300
  from the one user expected to be (newfd). Users of dup2 must therefor use the 
sl@0
   301
  return value of dup2 as the new allocated fd rather than the one passed in (newfd). 
sl@0
   302
  As described above, if dup2 is successful the newfd and return values are the 
sl@0
   303
  same, .
sl@0
   304
sl@0
   305
Examples:
sl@0
   306
@code
sl@0
   307
/*
sl@0
   308
 *Detailed description : Sample usage of dup system call
sl@0
   309
 */
sl@0
   310
#include <unistd.h>
sl@0
   311
#include <fcntl.h>
sl@0
   312
#include <stdio.h>
sl@0
   313
int main()
sl@0
   314
{
sl@0
   315
  int fd;
sl@0
   316
  FILE *Fil;
sl@0
   317
  int Newfd;
sl@0
   318
  fd = open("Example.txt" , O_CREAT | O_RDWR , 0666);
sl@0
   319
  if(fd < 0 )  {
sl@0
   320
     printf("Failed to open file Example.txt");
sl@0
   321
     return -1;
sl@0
   322
  }
sl@0
   323
  Newfd  = dup(fd );
sl@0
   324
  if(Newfd < 0 ) 
sl@0
   325
  {
sl@0
   326
    printf("Failed to duplicate file descriptor");
sl@0
   327
    return -1 ;
sl@0
   328
  }
sl@0
   329
  close(fd);
sl@0
   330
  close(Newfd);
sl@0
   331
  printf("New Duped fd is %d" , Newfd);
sl@0
   332
  return 0;
sl@0
   333
}
sl@0
   334
sl@0
   335
@endcode
sl@0
   336
 Output
sl@0
   337
@code
sl@0
   338
New Duped fd is 4
sl@0
   339
sl@0
   340
@endcode
sl@0
   341
@code
sl@0
   342
/*
sl@0
   343
 *Detailed description : Sample usage of dup system call
sl@0
   344
 */
sl@0
   345
#include <unistd.h>
sl@0
   346
#include <fcntl.h>
sl@0
   347
#include <errno.h>
sl@0
   348
#include <stdio.h>
sl@0
   349
int main()
sl@0
   350
{
sl@0
   351
  int fd;
sl@0
   352
  FILE *Fil;
sl@0
   353
  int Newfd;
sl@0
   354
  fd = open("Example.txt" , O_CREAT | O_RDWR , 0666);
sl@0
   355
  if(fd < 0 )  {
sl@0
   356
     printf("Failed to open file Example.txt");
sl@0
   357
     return -1;
sl@0
   358
  }
sl@0
   359
  Newfd  = dup2(fd  , 4);
sl@0
   360
  if(Newfd < 0 )  {
sl@0
   361
    printf("Failed to duplicate file descriptor");
sl@0
   362
    return -1;
sl@0
   363
  }
sl@0
   364
  close(fd);
sl@0
   365
  close(Newfd);
sl@0
   366
  printf("New Duped fd is %d" , Newfd);
sl@0
   367
  return 0;
sl@0
   368
}
sl@0
   369
sl@0
   370
@endcode
sl@0
   371
 Output
sl@0
   372
@code
sl@0
   373
New Duped fd is 4
sl@0
   374
sl@0
   375
@endcode
sl@0
   376
@see accept()
sl@0
   377
@see close()
sl@0
   378
@see fcntl()
sl@0
   379
@see getdtablesize()
sl@0
   380
@see open()
sl@0
   381
@see pipe()
sl@0
   382
@see socket()
sl@0
   383
sl@0
   384
sl@0
   385
 
sl@0
   386
sl@0
   387
@publishedAll
sl@0
   388
@externallyDefinedApi
sl@0
   389
*/
sl@0
   390
sl@0
   391
/** @fn  dup2(int aFid1, int aFid2)
sl@0
   392
@param aFid1
sl@0
   393
@param aFid2
sl@0
   394
sl@0
   395
Refer to  dup() for the documentation
sl@0
   396
@see accept()
sl@0
   397
@see close()
sl@0
   398
@see fcntl()
sl@0
   399
@see getdtablesize()
sl@0
   400
@see open()
sl@0
   401
@see pipe()
sl@0
   402
@see socket()
sl@0
   403
sl@0
   404
sl@0
   405
 
sl@0
   406
sl@0
   407
@publishedAll
sl@0
   408
@externallyDefinedApi
sl@0
   409
*/
sl@0
   410
sl@0
   411
/** @fn  fpathconf(int fd, int name)
sl@0
   412
@param fd
sl@0
   413
@param name
sl@0
   414
sl@0
   415
Refer to  pathconf() for the documentation
sl@0
   416
sl@0
   417
sl@0
   418
 
sl@0
   419
sl@0
   420
@publishedAll
sl@0
   421
@externallyDefinedApi
sl@0
   422
*/
sl@0
   423
sl@0
   424
/** @fn  getcwd(char *_buf, size_t _size)
sl@0
   425
@param _buf
sl@0
   426
@param _size
sl@0
   427
@return   Upon successful completion a pointer to the pathname is returned. Otherwise 
sl@0
   428
a NULL pointer is returned and the global variable errno is set to indicate the error. In addition, getwd copies the error message associated with errno into the memory referenced by buf.
sl@0
   429
sl@0
   430
  The getcwd function copies the absolute pathname of the current working directory
sl@0
   431
into the memory referenced by buf and returns a pointer to buf. The size argument is the _size, in bytes, of the array referenced by buf.
sl@0
   432
sl@0
   433
 If _buf is NULL, space is allocated as indicated by size to store the pathname and the current working directory is
sl@0
   434
returned as long as the _size bytes are sufficient to hold the working directory name.
sl@0
   435
This space may later be free’d.
sl@0
   436
sl@0
   437
 This routine has traditionally been used by programs to save the
sl@0
   438
name of a working directory for the purpose of returning to it.
sl@0
   439
A much faster and less error-prone method of accomplishing this is to
sl@0
   440
open the current directory ((‘.’) and use the fchdir function to return.
sl@0
   441
sl@0
   442
Examples:
sl@0
   443
@code
sl@0
   444
#include<unistd.h>
sl@0
   445
#include<stdio.h>
sl@0
   446
#include <stdlib.h>
sl@0
   447
#define BUF_SIZE 100
sl@0
   448
  
sl@0
   449
int main()
sl@0
   450
{
sl@0
   451
 //change directory to c:
sl@0
   452
 int c;
sl@0
   453
 long size = BUF_SIZE;
sl@0
   454
 char *buf = NULL;
sl@0
   455
 char *ptr = NULL;
sl@0
   456
  
sl@0
   457
 c = chdir("c:\");
sl@0
   458
  
sl@0
   459
 buf = (char *)malloc((size_t)size);
sl@0
   460
  
sl@0
   461
 if (buf != NULL && c == 0)
sl@0
   462
 {
sl@0
   463
  //call getcwd to fetch teh current directory
sl@0
   464
  ptr = getcwd(buf, (size_t)size);
sl@0
   465
  printf("getcwd returned: %s", ptr);
sl@0
   466
 }
sl@0
   467
   
sl@0
   468
 return 0;
sl@0
   469
}
sl@0
   470
sl@0
   471
@endcode
sl@0
   472
 Output
sl@0
   473
@code
sl@0
   474
getcwd returned: c:
sl@0
   475
sl@0
   476
@endcode
sl@0
   477
sl@0
   478
Notes:
sl@0
   479
sl@0
   480
 The getcwd function
sl@0
   481
returns the default working directory as c:\\private\\XXXXXXXX (where XXXXXXXX is the UID of the process) as the default session path is
sl@0
   482
initialised to c:\\private\\current_process'_UID, in case of Symbian OS.
sl@0
   483
@see chdir()
sl@0
   484
@see malloc()
sl@0
   485
@see strerror()
sl@0
   486
sl@0
   487
sl@0
   488
 
sl@0
   489
sl@0
   490
@publishedAll
sl@0
   491
@externallyDefinedApi
sl@0
   492
*/
sl@0
   493
sl@0
   494
/** @fn  getegid(void)
sl@0
   495
Refer to  getgid() for the documentation
sl@0
   496
sl@0
   497
sl@0
   498
 
sl@0
   499
sl@0
   500
@publishedAll
sl@0
   501
@externallyDefinedApi
sl@0
   502
*/
sl@0
   503
sl@0
   504
/** @fn  geteuid(void)
sl@0
   505
Refer to  getuid() for the documentation
sl@0
   506
sl@0
   507
sl@0
   508
 
sl@0
   509
sl@0
   510
@publishedAll
sl@0
   511
@externallyDefinedApi
sl@0
   512
*/
sl@0
   513
sl@0
   514
/** @fn  getgid(void)
sl@0
   515
sl@0
   516
sl@0
   517
Note: This description also covers the following functions -
sl@0
   518
 getegid() 
sl@0
   519
sl@0
   520
@return   These functions always return 0.
sl@0
   521
sl@0
   522
  getgid and getegid are build supported but not available functionally. Symbian OS 
sl@0
   523
does not support multiple users and groups.
sl@0
   524
sl@0
   525
sl@0
   526
sl@0
   527
 
sl@0
   528
sl@0
   529
@publishedAll
sl@0
   530
@externallyDefinedApi
sl@0
   531
*/
sl@0
   532
sl@0
   533
sl@0
   534
/** @fn  getgroups(int size, gid_t grouplist[])
sl@0
   535
@param size
sl@0
   536
@param grouplist
sl@0
   537
@return   These functions always return 0.
sl@0
   538
sl@0
   539
  The getgroups function build supported but not available functionally. Symbian 
sl@0
   540
OS does not support multiple users and groups.
sl@0
   541
sl@0
   542
sl@0
   543
sl@0
   544
sl@0
   545
sl@0
   546
 
sl@0
   547
sl@0
   548
@publishedAll
sl@0
   549
@externallyDefinedApi
sl@0
   550
*/
sl@0
   551
sl@0
   552
/** @fn  getpgrp(void)
sl@0
   553
Note: This description also covers the following functions -
sl@0
   554
 getpgid() 
sl@0
   555
sl@0
   556
@return   These functions always return 0.
sl@0
   557
sl@0
   558
  getpgrp and getpgid are build supported but not available functionally. Symbian OS 
sl@0
   559
does not support multiple users and groups.
sl@0
   560
sl@0
   561
sl@0
   562
sl@0
   563
sl@0
   564
sl@0
   565
 
sl@0
   566
sl@0
   567
@publishedAll
sl@0
   568
@externallyDefinedApi
sl@0
   569
*/
sl@0
   570
sl@0
   571
/** @fn  getpid(void)
sl@0
   572
sl@0
   573
Note: This description also covers the following functions -
sl@0
   574
 getppid() 
sl@0
   575
sl@0
   576
  The getpid system call returns the process ID of the calling process. Though 
sl@0
   577
the ID is guaranteed to be unique it should NOT be used for constructing temporary file names for security reasons; 
sl@0
   578
see mkstemp instead.
sl@0
   579
sl@0
   580
 The getppid system call
sl@0
   581
returns the process ID of the parent
sl@0
   582
of the calling process.
sl@0
   583
sl@0
   584
Examples:
sl@0
   585
@code
sl@0
   586
/*
sl@0
   587
 * Detailed description : Sample usage of getpid system call
sl@0
   588
 */
sl@0
   589
#include <unistd.h>
sl@0
   590
int main() 
sl@0
   591
{
sl@0
   592
  pid_t pid ;
sl@0
   593
  if((pid = getpid()) < 0 ) 
sl@0
   594
  {
sl@0
   595
     printf("getpid system call failed") ;
sl@0
   596
     return -1 ;
sl@0
   597
  }
sl@0
   598
  printf("pid of this process is %d " , pid) ;
sl@0
   599
  return 0 ;
sl@0
   600
}
sl@0
   601
sl@0
   602
@endcode
sl@0
   603
sl@0
   604
sl@0
   605
 
sl@0
   606
sl@0
   607
@publishedAll
sl@0
   608
@externallyDefinedApi
sl@0
   609
*/
sl@0
   610
sl@0
   611
/** @fn  getppid(void)
sl@0
   612
Refer to  getpid() for the documentation
sl@0
   613
sl@0
   614
sl@0
   615
 
sl@0
   616
sl@0
   617
@publishedAll
sl@0
   618
@externallyDefinedApi
sl@0
   619
*/
sl@0
   620
sl@0
   621
/** @fn  getuid(void)
sl@0
   622
Note: This description also covers the following functions -
sl@0
   623
 geteuid() 
sl@0
   624
sl@0
   625
@return   These functions always return 0.
sl@0
   626
sl@0
   627
  getuid and geteuid are build supported but not available functionally. Symbian OS 
sl@0
   628
does not support multiple users and groups.
sl@0
   629
sl@0
   630
sl@0
   631
sl@0
   632
 
sl@0
   633
sl@0
   634
@publishedAll
sl@0
   635
@externallyDefinedApi
sl@0
   636
*/
sl@0
   637
sl@0
   638
/** @fn  isatty(int fd)
sl@0
   639
@param fd
sl@0
   640
@return   The isatty returns 1 if fd is an open descriptor connected to a terminal; returns 0 otherwise.
sl@0
   641
sl@0
   642
  This function operate on the system file descriptors for character special devices.
sl@0
   643
sl@0
   644
 The isatty function
sl@0
   645
determines if the file descriptor fd refers to a valid
sl@0
   646
terminal type device.
sl@0
   647
sl@0
   648
Examples:
sl@0
   649
@code
sl@0
   650
#include<unistd.h>
sl@0
   651
#include<stdio.h>
sl@0
   652
#include<fcntl.h> //O_APPEND
sl@0
   653
 
sl@0
   654
int main()
sl@0
   655
{
sl@0
   656
 int x = isatty(0); //stdin (fd = 0)
sl@0
   657
 int y = isatty(1); //stdout (fd = 1)
sl@0
   658
 int z = isatty(2); //stderr (fd = 2)
sl@0
   659
 
sl@0
   660
 printf("{Expected: 1 1 1} %d %d %d", x, y, z);
sl@0
   661
 
sl@0
   662
 int i = isatty(5); //some invalid fd
sl@0
   663
  
sl@0
   664
 int fd_file = open("c:\some.txt", O_APPEND);
sl@0
   665
  
sl@0
   666
 int j = isatty(fd_file); //valid fd of a text file
sl@0
   667
  
sl@0
   668
 int fd_pipe[3];
sl@0
   669
 int p = pipe(fd_pipe);
sl@0
   670
  
sl@0
   671
 int k = isatty(fd_pipe[1]); //valid fd of a pipe
sl@0
   672
       
sl@0
   673
 close(fd_file);         
sl@0
   674
 close(fd_pipe[0]);      
sl@0
   675
 close(fd_pipe[1]);
sl@0
   676
      
sl@0
   677
 printf("{Expected: 0 0 0} %d %d %d", i, j, k);
sl@0
   678
 
sl@0
   679
 unlink("c:\some.txt");
sl@0
   680
 
sl@0
   681
 return 0;
sl@0
   682
}
sl@0
   683
sl@0
   684
@endcode
sl@0
   685
 Output
sl@0
   686
@code
sl@0
   687
{Expected: 1 1 1} 1 1 1
sl@0
   688
{Expected: 0 0 0} 0 0 0
sl@0
   689
sl@0
   690
@endcode
sl@0
   691
@see ioctl()
sl@0
   692
sl@0
   693
sl@0
   694
 
sl@0
   695
sl@0
   696
@publishedAll
sl@0
   697
@externallyDefinedApi
sl@0
   698
*/
sl@0
   699
sl@0
   700
/** @fn  link(const char *oldpath, const char *newpath)
sl@0
   701
@param oldpath
sl@0
   702
@param newpath
sl@0
   703
@return   Returns 0 on successful completion. Otherwise returns -1 and sets errno to indicate the error.
sl@0
   704
sl@0
   705
  The link system call atomically creates the specified directory entry (hard 
sl@0
   706
link) newpath with the attributes of the underlying object pointed at by oldpath. Note that if the link is successful the link count of the underlying 
sl@0
   707
object is not incremented: On Symbian OS link functionality is simulated and the 
sl@0
   708
underlying object is not aware of a existing link. Link is supported only on regular files and fifos. It is not on directories. Creation 
sl@0
   709
of link on a existing link file is not supported.
sl@0
   710
sl@0
   711
 If oldpath is removed, the file newpath is also deleted as the platform recognizes the underlying object only by oldpath.
sl@0
   712
sl@0
   713
 The object pointed at by the oldpath argument must exist for the hard link to succeed and both oldpath and newpath must be in the same file system. The oldpath argument may not be a directory. Creation time stamp of the file 
sl@0
   714
  is not supported and access time stamp is equal to modification time stamp. 
sl@0
   715
  A newly created file will not alter the time stamp of parent directory.
sl@0
   716
sl@0
   717
Examples:
sl@0
   718
@code
sl@0
   719
/*
sl@0
   720
 * Detailed description  : Example to create link to a file
sl@0
   721
 * Precondition : "Parent.txt" should exist in c: drive
sl@0
   722
 *
sl@0
   723
 */
sl@0
   724
#include <unistd.h>
sl@0
   725
#include <stdio.h>
sl@0
   726
int main(void)
sl@0
   727
 {
sl@0
   728
    if(link("C:\Parent.txt","C:\Link") < 0)
sl@0
   729
    {
sl@0
   730
         printf("Link creation to parent file failed");
sl@0
   731
         return -1;
sl@0
   732
    }
sl@0
   733
    printf("Link to parent file created");
sl@0
   734
    return 0;
sl@0
   735
 }
sl@0
   736
sl@0
   737
@endcode
sl@0
   738
 Output
sl@0
   739
@code
sl@0
   740
Link to parent file created.
sl@0
   741
sl@0
   742
@endcode
sl@0
   743
sl@0
   744
Limitations:
sl@0
   745
sl@0
   746
- The oldpath and newpath parameters of the link() function should not exceed 256 characters in length. 
sl@0
   747
- P.I.P.S. only simulates link files and does not distinguish between hard and symbolic links.
sl@0
   748
sl@0
   749
- KErrNotReady of Symbian error code is mapped to ENOENT, which typically means drive
sl@0
   750
not found or filesystem not mounted on the drive.
sl@0
   751
sl@0
   752
@see readlink()
sl@0
   753
@see symlink()
sl@0
   754
@see unlink()
sl@0
   755
sl@0
   756
sl@0
   757
sl@0
   758
@capability Deferred @ref RFs::Delete(const TDesC16&)
sl@0
   759
sl@0
   760
@publishedAll
sl@0
   761
@externallyDefinedApi
sl@0
   762
*/
sl@0
   763
sl@0
   764
/** @fn lseek(int fd, off_t pos, int whence)
sl@0
   765
@param fd
sl@0
   766
@param pos
sl@0
   767
@param whence
sl@0
   768
@return Upon successful completion,  lseek returns the resulting offset location as measured in bytes from the beginning of the file. Otherwise, a value of -1 is returned and  errno is set to indicate the error.
sl@0
   769
sl@0
   770
The  lseek system call repositions the offset of the file descriptor  fildes to the argument  offset according to the directive  whence. The argument  fildes must be an open file descriptor. The  lseek system call repositions the file position pointer associated with the file descriptor  fildes as follows:
sl@0
   771
	If whence is SEEK_SET, the offset is set to offset bytes.
sl@0
   772
	If whence is SEEK_CUR, the offset is set to its current location plus offset bytes.
sl@0
   773
	If whence is SEEK_END, the offset is set to the size of the file plus offset bytes.
sl@0
   774
Some devices are incapable of seeking. The value of the pointer associated with such a device is undefined.
sl@0
   775
sl@0
   776
If 'fd' refers to a shared memory object then lseek() on the shared memory object is supported by the current implementation.
sl@0
   777
sl@0
   778
Note : lseek function allows the file offset to be set beyond the existing end-of-file, data in the seeked slot is undefined, and hence the read operation in seeked slot is undefined untill data is actually written into it. lseek beyond existing end-of-file increases the file size accordingly.
sl@0
   779
sl@0
   780
Errors:
sl@0
   781
sl@0
   782
The  lseek system call will fail and the file position pointer will remain unchanged if:
sl@0
   783
[EBADF]	The fildes argument is not an open file descriptor.
sl@0
   784
[EINVAL] 	The whence argument is not a proper value or the resulting file offset would be negative for a non-character special file.
sl@0
   785
[EOVERFLOW]	The resulting file offset would be a value which cannot be represented correctly in an object of type off_t(Not supported).
sl@0
   786
[ESPIPE] 	The fildes argument is associated with a pipe, socket, or FIFO.
sl@0
   787
sl@0
   788
Examples:
sl@0
   789
@code
sl@0
   790
/*
sl@0
   791
 * Detailed description  : Example for lseek usage.
sl@0
   792
 */
sl@0
   793
#include <stdio.h>
sl@0
   794
#include <sys/stat.h>
sl@0
   795
#include <fcntl.h>
sl@0
   796
#include <sys/types.h>
sl@0
   797
int main()
sl@0
   798
{
sl@0
   799
int fd = 0;
sl@0
   800
 fd = open("lseek.txt"  , O_CREAT | O_RDWR , 0666);
sl@0
   801
  if(lseek(fd , 0 , SEEK_SET) < 0 ) {
sl@0
   802
     printf("Lseek on file lseek.txt failed \n");
sl@0
   803
      return -1;
sl@0
   804
  }
sl@0
   805
  printf("Lseek on lseek.txt passed ");
sl@0
   806
 return 0;
sl@0
   807
}
sl@0
   808
sl@0
   809
@endcode
sl@0
   810
Output
sl@0
   811
@code
sl@0
   812
Lseek on lseek.txt passed
sl@0
   813
@endcode
sl@0
   814
sl@0
   815
@see dup()
sl@0
   816
@see open()
sl@0
   817
sl@0
   818
 
sl@0
   819
sl@0
   820
@publishedAll
sl@0
   821
@externallyDefinedApi
sl@0
   822
*/
sl@0
   823
sl@0
   824
/** @fn  lseek64(int fildes, off64_t offset, int whence)
sl@0
   825
@param fildes
sl@0
   826
@param offset
sl@0
   827
@param whence
sl@0
   828
@return   Upon successful completion, lseek64 returns the resulting offset location as measured in bytes from the
sl@0
   829
beginning of the file.
sl@0
   830
Otherwise,
sl@0
   831
a value of -1 is returned and errno is set to indicate
sl@0
   832
the error.
sl@0
   833
sl@0
   834
For full documentation see: http://www.unix.org/version2/whatsnew/lfs20mar.html#3.0
sl@0
   835
sl@0
   836
@see lseek()
sl@0
   837
 
sl@0
   838
sl@0
   839
@publishedAll
sl@0
   840
@externallyDefinedApi
sl@0
   841
*/
sl@0
   842
sl@0
   843
/** @fn  pathconf(const char *path, int name)
sl@0
   844
@param path
sl@0
   845
@param name
sl@0
   846
sl@0
   847
Note: This description also covers the following functions -
sl@0
   848
 fpathconf() 
sl@0
   849
sl@0
   850
@return   If the call to pathconf or fpathconf is not successful, -1 is returned and errno is set appropriately.
sl@0
   851
Otherwise, if the variable is associated with functionality that does
sl@0
   852
not have a limit in the system, -1 is returned and errno is not modified.
sl@0
   853
Otherwise, the current variable value is returned.
sl@0
   854
sl@0
   855
The pathconf and fpathconf system calls provide a method for applications to determine the current
sl@0
   856
value of a configurable system limit or option variable associated
sl@0
   857
with a pathname or file descriptor.
sl@0
   858
sl@0
   859
For pathconf, the path argument is the name of a file or directory.
sl@0
   860
For fpathconf, the fd argument is an open file descriptor.
sl@0
   861
The name argument specifies the system variable to be queried.
sl@0
   862
Symbolic constants for each name value are found in the include file \<unistd.h\>.
sl@0
   863
sl@0
   864
 The available values are as follows:
sl@0
   865
@code
sl@0
   866
 _PC_LINK_MAX
sl@0
   867
 	The maximum file link count.
sl@0
   868
_PC_MAX_CANON
sl@0
   869
 	The maximum number of bytes in terminal canonical input line.
sl@0
   870
_PC_MAX_INPUT
sl@0
   871
 	The minimum maximum number of bytes for which space is available in a terminal input queue.
sl@0
   872
_PC_NAME_MAX
sl@0
   873
 	The maximum number of bytes in a file name.
sl@0
   874
_PC_PATH_MAX
sl@0
   875
 	The maximum number of bytes in a pathname.
sl@0
   876
_PC_PIPE_BUF
sl@0
   877
 	The maximum number of bytes which will be written atomically to a pipe.
sl@0
   878
_PC_CHOWN_RESTRICTED
sl@0
   879
 	Return 1 if appropriate privilege is required for the chown system call, otherwise 0. -p1003.1-2001 requires appropriate privilege in all cases, but this behavior was optional in prior editions of the standard.
sl@0
   880
_PC_NO_TRUNC
sl@0
   881
 	Return greater than zero if attempts to use pathname components longer than
sl@0
   882
.Brq Dv NAME_MAX will result in an [ENAMETOOLONG] error; otherwise, such components will be truncated to
sl@0
   883
.Brq Dv NAME_MAX. -p1003.1-2001 requires the error in all cases, but this behavior was optional in prior editions of the standard, and some non- POSIX -compliant file systems do not support this behavior.
sl@0
   884
_PC_VDISABLE
sl@0
   885
 	Returns the terminal character disabling value.
sl@0
   886
_PC_ASYNC_IO
sl@0
   887
 	Return 1 if asynchronous I/O is supported, otherwise 0.
sl@0
   888
_PC_PRIO_IO
sl@0
   889
 	Returns 1 if prioritised I/O is supported for this file, otherwise 0.
sl@0
   890
_PC_SYNC_IO
sl@0
   891
 	Returns 1 if synchronised I/O is supported for this file, otherwise 0.
sl@0
   892
_PC_ALLOC_SIZE_MIN
sl@0
   893
 	Minimum number of bytes of storage allocated for any portion of a file.
sl@0
   894
_PC_FILESIZEBITS
sl@0
   895
 	Number of bits needed to represent the maximum file size.
sl@0
   896
_PC_REC_INCR_XFER_SIZE
sl@0
   897
 	Recommended increment for file transfer sizes between _PC_REC_MIN_XFER_SIZE and _PC_REC_MAX_XFER_SIZE.
sl@0
   898
_PC_REC_MAX_XFER_SIZE
sl@0
   899
 	Maximum recommended file transfer size.
sl@0
   900
_PC_REC_MIN_XFER_SIZE
sl@0
   901
 	Minimum recommended file transfer size.
sl@0
   902
_PC_REC_XFER_ALIGN
sl@0
   903
 	Recommended file transfer buffer alignment.
sl@0
   904
_PC_SYMLINK_MAX
sl@0
   905
 	Maximum number of bytes in a symbolic link.
sl@0
   906
_PC_ACL_EXTENDED
sl@0
   907
 	Returns 1 if an Access Control List (ACL) can be set on the specified file, otherwise 0.
sl@0
   908
_PC_ACL_PATH_MAX
sl@0
   909
 	Maximum number of ACL entries per file.
sl@0
   910
_PC_CAP_PRESENT
sl@0
   911
 	Returns 1 if a capability state can be set on the specified file, otherwise 0.
sl@0
   912
_PC_INF_PRESENT
sl@0
   913
 	Returns 1 if an information label can be set on the specified file, otherwise 0.
sl@0
   914
_PC_MAC_PRESENT
sl@0
   915
 	Returns 1 if a Mandatory Access Control (MAC) label can be set on the specified file, otherwise 0.
sl@0
   916
@endcode
sl@0
   917
  
sl@0
   918
Errors:
sl@0
   919
sl@0
   920
If any of the following conditions occur, the  pathconf and  fpathconf system calls shall return -1 and set  errno to the corresponding value.
sl@0
   921
[EINVAL]	The value of the name argument is invalid.
sl@0
   922
[EINVAL] 	The implementation does not support an association of the variable name with the associated file.
sl@0
   923
The pathconf system call will fail if:
sl@0
   924
[ENOTDIR] 	A component of the path prefix is not a directory.
sl@0
   925
[ENAMETOOLONG] 	A component of a pathname exceeded
sl@0
   926
.Brq Dv NAME_MAX characters (but see _PC_NO_TRUNC above), or an entire path name exceeded
sl@0
   927
.Brq Dv PATH_MAX characters.
sl@0
   928
[ENOENT] 	The named file does not exist.
sl@0
   929
[EACCES] 	Search permission is denied for a component of the path prefix.
sl@0
   930
[ELOOP] 	Too many symbolic links were encountered in translating the pathname.
sl@0
   931
[EIO] 	An I/O error occurred while reading from or writing to the file system.
sl@0
   932
The fpathconf system call will fail if:
sl@0
   933
[EBADF] 	The fd argument is not a valid open file descriptor.
sl@0
   934
[EIO] 	An I/O error occurred while reading from or writing to the file system.
sl@0
   935
sl@0
   936
Examples:
sl@0
   937
@code
sl@0
   938
#include<unistd.h>
sl@0
   939
#include<stdio.h>
sl@0
   940
int test_pathconf()
sl@0
   941
{
sl@0
   942
   int fp = open("test_pathconf1.txt", O_RDWR|O_CREAT);
sl@0
   943
   if(fp != -1)
sl@0
   944
   {
sl@0
   945
     int n = pathconf("test_pathconf1.txt", _PC_LINK_MAX);
sl@0
   946
     if( n < _POSIX_LINK_MAX )
sl@0
   947
     {
sl@0
   948
       return -1;
sl@0
   949
     }
sl@0
   950
     else
sl@0
   951
     {
sl@0
   952
       printf("_PC_LINK_MAX value: %d", n);
sl@0
   953
       printf("Pathconf passed");
sl@0
   954
       return 0;
sl@0
   955
     }
sl@0
   956
   }
sl@0
   957
   else
sl@0
   958
   {
sl@0
   959
     printf("failed");
sl@0
   960
     return -1;
sl@0
   961
   }    
sl@0
   962
}               
sl@0
   963
sl@0
   964
@endcode
sl@0
   965
 Output
sl@0
   966
@code
sl@0
   967
_PC_LINK_MAX value: 1
sl@0
   968
Pathconf passed
sl@0
   969
sl@0
   970
@endcode
sl@0
   971
sl@0
   972
sl@0
   973
Note:
sl@0
   974
sl@0
   975
@code
sl@0
   976
 The current implementation of the functions pathconf and fpathconf considers only the following configurable variables. _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_PATH_MAX _PC_PIPE_BUF _PC_CHOWN_RESTRICTED _PC_NO_TRUNC _PC_VDISABLE   Also, these functions return the limits as required by the POSIX
sl@0
   977
standard instead of the actual system limits determined on the run. 
sl@0
   978
@endcode
sl@0
   979
sl@0
   980
 
sl@0
   981
sl@0
   982
@publishedAll
sl@0
   983
@externallyDefinedApi
sl@0
   984
*/
sl@0
   985
sl@0
   986
/** @fn  pipe(int *fildes)
sl@0
   987
@param fildes
sl@0
   988
@return   The pipe function returns the value 0 if successful; otherwise the
sl@0
   989
value -1 is returned and errno is set to indicate the error.
sl@0
   990
sl@0
   991
  The pipe system call
sl@0
   992
creates a pipe, which is an object allowing
sl@0
   993
bidirectional data flow,
sl@0
   994
and allocates a pair of file descriptors.
sl@0
   995
sl@0
   996
 By convention, the first descriptor is normally used as the read end of the pipe, and the second is normally the write end, so that data written to fildes[1] appears on (i.e. can be read from) fildes[0]. This allows the output of one thread to be sent to another 
sl@0
   997
  thread: the source's standard output is set up to be the write end of the 
sl@0
   998
  pipe and the sink's standard input is set up to be the read end of the 
sl@0
   999
  pipe. The pipe itself persists until all its associated descriptors are closed.
sl@0
  1000
sl@0
  1001
 A pipe that has had an end closed is considered widowed. Writing on such a pipe causes the writing process to fail and errno is set to EPIPE . Widowing a pipe is the only way to deliver end-of-file to a 
sl@0
  1002
  reader: After the reader consumes any buffered data, reading a widowed pipe 
sl@0
  1003
  returns a zero count.
sl@0
  1004
sl@0
  1005
Examples:
sl@0
  1006
@code
sl@0
  1007
#include <unistd.h>
sl@0
  1008
#include <stdio.h>
sl@0
  1009
sl@0
  1010
int main(void)
sl@0
  1011
{
sl@0
  1012
    int fds[2];
sl@0
  1013
    if (pipe(fds) == -1) {
sl@0
  1014
       printf("Pipe creation failed");
sl@0
  1015
    }
sl@0
  1016
    /* fds[0] - opened for read */
sl@0
  1017
    /* fds[1] - opened for write */
sl@0
  1018
    close(fds[0]);
sl@0
  1019
    close(fds[1]);
sl@0
  1020
    return 0;
sl@0
  1021
}
sl@0
  1022
sl@0
  1023
@endcode
sl@0
  1024
@see read()
sl@0
  1025
@see write()
sl@0
  1026
sl@0
  1027
sl@0
  1028
 
sl@0
  1029
sl@0
  1030
@publishedAll
sl@0
  1031
@externallyDefinedApi
sl@0
  1032
*/
sl@0
  1033
sl@0
  1034
/** @fn  read(int fd, void *buf, size_t cnt)
sl@0
  1035
@param fd
sl@0
  1036
@param buf
sl@0
  1037
@param cnt
sl@0
  1038
sl@0
  1039
Note: This description also covers the following functions -
sl@0
  1040
 readv() 
sl@0
  1041
sl@0
  1042
@return   If successful, the number of bytes actually read is returned. Upon reading 
sl@0
  1043
end-of-file, zero is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
sl@0
  1044
sl@0
  1045
  The read system call
sl@0
  1046
attempts to read cnt bytes of data from the object referenced by the descriptor fd into the buffer pointed to by buf. The readv system call
sl@0
  1047
performs the same action, but scatters the input data
sl@0
  1048
into the iovcnt buffers specified by the members of the iov array: iov[0], iov[1], ..., iov[iovcnt-1].
sl@0
  1049
sl@0
  1050
 For readv the iovec structure is defined as:
sl@0
  1051
sl@0
  1052
 struct iovec {
sl@0
  1053
void   *iov_base;  // Base address. 
sl@0
  1054
size_t iov_len;    // Length. 
sl@0
  1055
};
sl@0
  1056
sl@0
  1057
 Each iovec entry specifies the base address and length of an area
sl@0
  1058
in memory where data should be placed.
sl@0
  1059
The readv system call
sl@0
  1060
will always fill an area completely before proceeding
sl@0
  1061
to the next.
sl@0
  1062
sl@0
  1063
 On objects capable of seeking, the read starts at a position
sl@0
  1064
given by the pointer associated with fd (see lseek )
sl@0
  1065
Upon return from read, the pointer is incremented by the number of bytes actually read.
sl@0
  1066
sl@0
  1067
If 'fd' refers to a shared memory object then read() on the shared memory object is supported by the current implementation.
sl@0
  1068
sl@0
  1069
 Objects that are not capable of seeking always read from the current
sl@0
  1070
position.
sl@0
  1071
The value of the pointer associated with such an
sl@0
  1072
object is undefined.
sl@0
  1073
sl@0
  1074
 Upon successful completion, read, and readv return the number of bytes actually read and placed in the buffer.
sl@0
  1075
The system guarantees to read the number of bytes requested if
sl@0
  1076
the descriptor references a normal file that has that many bytes left
sl@0
  1077
before the end-of-file, but in no other case.
sl@0
  1078
sl@0
  1079
Errors:
sl@0
  1080
sl@0
  1081
The  read, and  readv system calls will succeed unless:
sl@0
  1082
[EBADF] 	The d argument is not a valid file or socket descriptor open for reading.
sl@0
  1083
[ECONNRESET]The d argument refers to a socket, and the remote socket end is forcibly closed.
sl@0
  1084
[EFAULT] 	The buf argument points outside the allocated address space(Not supported).
sl@0
  1085
[EIO] 	An I/O error occurred while reading from the file system(Not supported).
sl@0
  1086
[EINTR] 	A read from a slow device was interrupted before any data arrived by the delivery of a signal(Not supported).
sl@0
  1087
[EINVAL] 	The pointer associated with d was negative.
sl@0
  1088
[EAGAIN] 	The file was marked for non-blocking I/O, and no data were ready to be read.
sl@0
  1089
[EISDIR] 	The file descriptor is associated with a directory residing on a file system that does not allow regular read operations on directories (e.g. NFS)(Not supported).
sl@0
  1090
[EOPNOTSUPP] 	The file descriptor is associated with a file system and file type that do not allow regular read operations on it(Not supported).
sl@0
  1091
[EOVERFLOW] 	The file descriptor is associated with a regular file, nbytes is greater than 0, offset is before the end-of-file, and offset is greater than or equal to the offset maximum established for this file system(Not supported).
sl@0
  1092
[EINVAL] 	The value nbytes is greater than INT_MAX.
sl@0
  1093
In addition, readv and preadv may return one of the following errors:
sl@0
  1094
[EINVAL] 	The iovcnt argument was less than or equal to 0, or greater than IOV_MAX.
sl@0
  1095
[EINVAL] 	One of the iov_len values in the iov array was negative.
sl@0
  1096
[EINVAL] 	The sum of the iov_len values in the iov array overflowed a 32-bit integer.
sl@0
  1097
[EFAULT] 	Part of the iov array points outside the process’s allocated address space.
sl@0
  1098
sl@0
  1099
Examples:
sl@0
  1100
@code
sl@0
  1101
/* Detailed description :This example demonstrates usage of read-system call, this
sl@0
  1102
 * Example reads 10 bytes from a file specified
sl@0
  1103
 *
sl@0
  1104
 * Preconditions: Example.txt file should be present in C: and should contain
sl@0
  1105
 * string Hello World.
sl@0
  1106
 *
sl@0
  1107
 */  
sl@0
  1108
#include <unistd.h>
sl@0
  1109
#include <sys/types.h>
sl@0
  1110
#include <sys/stat.h>
sl@0
  1111
#include <fcntl.h>
sl@0
  1112
int main()
sl@0
  1113
{
sl@0
  1114
  int fd = 0;
sl@0
  1115
  char Buff[12] = {0};
sl@0
  1116
 
sl@0
  1117
  fd = open("C:\Example.txt" , O_RDONLY );
sl@0
  1118
 
sl@0
  1119
  if(fd < 0 )  {
sl@0
  1120
     printf("Failed to open C:\Example.txt file");
sl@0
  1121
     return -1;
sl@0
  1122
  }
sl@0
  1123
 
sl@0
  1124
  if(read(fd , Buff , 11) < 11)   {
sl@0
  1125
     printf("Failed to read specified number of bytes from file");
sl@0
  1126
     return -1;
sl@0
  1127
  }
sl@0
  1128
 
sl@0
  1129
  printf("file contains %s 
sl@0
  1130
" , Buff);
sl@0
  1131
  return 0;
sl@0
  1132
}
sl@0
  1133
sl@0
  1134
@endcode
sl@0
  1135
 Output
sl@0
  1136
@code
sl@0
  1137
file contains Hello World
sl@0
  1138
sl@0
  1139
@endcode
sl@0
  1140
@code
sl@0
  1141
/*
sl@0
  1142
 * Detailed description: Sample usage of readv system call
sl@0
  1143
 * Preconditions: Example.txt file should be present in working directory containing  Hello world   in it
sl@0
  1144
 *
sl@0
  1145
 */
sl@0
  1146
#include <stdio.h>
sl@0
  1147
#include <sys/types.h>
sl@0
  1148
#include <sys/uio.h>
sl@0
  1149
#include <fcntl.h>
sl@0
  1150
int main()
sl@0
  1151
{
sl@0
  1152
  int fd = 0;
sl@0
  1153
  struct iovec io_vec[1];
sl@0
  1154
  char Buf[12] = { 0 };
sl@0
  1155
  io_vec[0].iov_base  = Buf;
sl@0
  1156
  io_vec[0].iov_len = 11;
sl@0
  1157
  fd = open("Example.txt" , O_RDONLY );
sl@0
  1158
  if(fd < 0 )  {
sl@0
  1159
    printf("File open failed");
sl@0
  1160
    return -1;
sl@0
  1161
  }
sl@0
  1162
  if(readv(fd , io_vec , 1) <  11 )   {
sl@0
  1163
    printf("Failed to read fron Example.txt file");
sl@0
  1164
    return -1;
sl@0
  1165
  }
sl@0
  1166
  printf("Read succes %s"  , io_vec[0].iov_base);
sl@0
  1167
  return 0;
sl@0
  1168
}
sl@0
  1169
sl@0
  1170
@endcode
sl@0
  1171
 Output
sl@0
  1172
@code
sl@0
  1173
Read succes Hello World
sl@0
  1174
sl@0
  1175
@endcode
sl@0
  1176
@see dup()
sl@0
  1177
@see fcntl()
sl@0
  1178
@see getdirentries()
sl@0
  1179
@see open()
sl@0
  1180
@see pipe()
sl@0
  1181
@see select()
sl@0
  1182
@see socket()
sl@0
  1183
@see socketpair()
sl@0
  1184
@see fread()
sl@0
  1185
@see readdir()
sl@0
  1186
sl@0
  1187
sl@0
  1188
 
sl@0
  1189
sl@0
  1190
@publishedAll
sl@0
  1191
@externallyDefinedApi
sl@0
  1192
*/
sl@0
  1193
sl@0
  1194
/** @fn  rmdir(const char *_path)
sl@0
  1195
@param _path
sl@0
  1196
@return   The rmdir() function returns the value 0 if successful; otherwise the
sl@0
  1197
value -1 is returned and the global variable errno is set to indicate the
sl@0
  1198
error.
sl@0
  1199
sl@0
  1200
The rmdir system call removes a directory file whose name is given by path. 
sl@0
  1201
The directory must not have any entries other than '.' and '..'.
sl@0
  1202
Examples:
sl@0
  1203
@code
sl@0
  1204
/*
sl@0
  1205
 *  Detailed description: This test code demonstrates usage of rmdir systemcall, it removes directory
sl@0
  1206
 *  Example from the current working directory.
sl@0
  1207
 *
sl@0
  1208
 *  Preconditions: Expects empty directory "Example" in current working directory.
sl@0
  1209
 */
sl@0
  1210
#include  <unistd.h>
sl@0
  1211
int main()
sl@0
  1212
{
sl@0
  1213
  if(rmdir("Example") < 0 )  
sl@0
  1214
  {
sl@0
  1215
     printf("Rmdir failed");
sl@0
  1216
     return -1;
sl@0
  1217
  }
sl@0
  1218
  printf("Directory Example removed");
sl@0
  1219
  return 0;
sl@0
  1220
}
sl@0
  1221
sl@0
  1222
@endcode
sl@0
  1223
 Output
sl@0
  1224
Directory Example removed
sl@0
  1225
@code
sl@0
  1226
sl@0
  1227
@endcode
sl@0
  1228
sl@0
  1229
Limitations:
sl@0
  1230
sl@0
  1231
The _path parameter of the rmdir() function should not exceed 256 characters in length. 
sl@0
  1232
sl@0
  1233
KErrNotReady of Symbian error code is mapped to ENOENT, which typically means drive
sl@0
  1234
not found or filesystem not mounted on the drive.
sl@0
  1235
sl@0
  1236
@capability Deferred @ref RFs::RmDir(const TDesC16&)
sl@0
  1237
@capability Deferred @ref RFs::Att(const TDesC16&, unsigned&)
sl@0
  1238
sl@0
  1239
@publishedAll
sl@0
  1240
@externallyDefinedApi
sl@0
  1241
*/
sl@0
  1242
sl@0
  1243
/** @fn  setgid(gid_t gid)
sl@0
  1244
@param gid
sl@0
  1245
sl@0
  1246
Refer to  setuid() for the documentation
sl@0
  1247
sl@0
  1248
sl@0
  1249
 
sl@0
  1250
sl@0
  1251
@publishedAll
sl@0
  1252
@externallyDefinedApi
sl@0
  1253
*/
sl@0
  1254
sl@0
  1255
/** @fn  setpgid(pid_t pid, pid_t pgid)
sl@0
  1256
@param pid
sl@0
  1257
@param pgid
sl@0
  1258
sl@0
  1259
Note: This description also covers the following functions -
sl@0
  1260
 setpgrp() 
sl@0
  1261
sl@0
  1262
@return   These functions always return 0.
sl@0
  1263
sl@0
  1264
  These functions are build supported but not available functionally. Symbian 
sl@0
  1265
OS does not support multiple users and groups.
sl@0
  1266
sl@0
  1267
sl@0
  1268
sl@0
  1269
 
sl@0
  1270
sl@0
  1271
@publishedAll
sl@0
  1272
@externallyDefinedApi
sl@0
  1273
*/
sl@0
  1274
sl@0
  1275
/** @fn  setsid(void)
sl@0
  1276
sl@0
  1277
@return   These functions always return 0.
sl@0
  1278
sl@0
  1279
  These functions are build supported but not available functionally. Symbian 
sl@0
  1280
OS does not support multiple users and groups.
sl@0
  1281
sl@0
  1282
sl@0
  1283
sl@0
  1284
 
sl@0
  1285
sl@0
  1286
@publishedAll
sl@0
  1287
@externallyDefinedApi
sl@0
  1288
*/
sl@0
  1289
sl@0
  1290
/** @fn  setuid(uid_t uid)
sl@0
  1291
@param uid
sl@0
  1292
sl@0
  1293
Note: This description also covers the following functions -
sl@0
  1294
 seteuid()  setgid()  setegid() 
sl@0
  1295
sl@0
  1296
@return   These functions always return 0.
sl@0
  1297
sl@0
  1298
  These functions are build supported but not available functionally. Symbian 
sl@0
  1299
OS does not support multiple users and groups.
sl@0
  1300
sl@0
  1301
sl@0
  1302
sl@0
  1303
 
sl@0
  1304
sl@0
  1305
@publishedAll
sl@0
  1306
@externallyDefinedApi
sl@0
  1307
*/
sl@0
  1308
sl@0
  1309
/** @fn  sleep(unsigned int secs)
sl@0
  1310
@param secs
sl@0
  1311
@return   If the sleep function returns because the requested time has elapsed, the value
sl@0
  1312
returned will be zero.
sl@0
  1313
sl@0
  1314
  The sleep function suspends execution of the calling process until seconds seconds have elapse
sl@0
  1315
sl@0
  1316
 Time interval is internally represented using 32 bit value(range +-2147483647). 
sl@0
  1317
  Any time interval greater 2147483647 returns 0 without sleeping. Hence Maximum 
sl@0
  1318
  sleep time supported here is 35 minutes, 47 seconds.
sl@0
  1319
sl@0
  1320
sl@0
  1321
sl@0
  1322
Examples:
sl@0
  1323
@code
sl@0
  1324
/*
sl@0
  1325
 * Detailed description: This test code shows usage of sleep system call , here sample code
sl@0
  1326
 * sleeps for 2 seconds.
sl@0
  1327
 */
sl@0
  1328
#include <unistd.h>
sl@0
  1329
int main()
sl@0
  1330
{
sl@0
  1331
  if(sleep(2) < 0 )  
sl@0
  1332
  {
sl@0
  1333
    printf("Sleep failed");
sl@0
  1334
    return -1;
sl@0
  1335
  }
sl@0
  1336
  printf("Sleep successful");
sl@0
  1337
  return 0;
sl@0
  1338
}
sl@0
  1339
sl@0
  1340
@endcode
sl@0
  1341
 Output
sl@0
  1342
@code
sl@0
  1343
Sleep successful
sl@0
  1344
sl@0
  1345
@endcode
sl@0
  1346
@see nanosleep()
sl@0
  1347
sl@0
  1348
sl@0
  1349
 
sl@0
  1350
sl@0
  1351
@publishedAll
sl@0
  1352
@externallyDefinedApi
sl@0
  1353
*/
sl@0
  1354
sl@0
  1355
/** @fn  sysconf(int name)
sl@0
  1356
@param name
sl@0
  1357
@return   If the call to sysconf is not successful, -1 is returned and errno is set appropriately.
sl@0
  1358
Otherwise, if the variable is associated with functionality that is not
sl@0
  1359
supported, -1 is returned and errno is not modified.
sl@0
  1360
Otherwise, the current variable value is returned.
sl@0
  1361
sl@0
  1362
This interface is defined by -p1003.1-88 .A far more complete interface is available using sysctl.
sl@0
  1363
sl@0
  1364
sl@0
  1365
The sysconf function provides a method for applications to determine the 
sl@0
  1366
  current value of a configurable system limit or option variable. The name argument specifies the system variable to be queried. Symbolic 
sl@0
  1367
  constants for each name value are found in the include file \#include \<unistd.h\> . Shell programmers who need access 
sl@0
  1368
  to these parameters should use the getconf utility.
sl@0
  1369
sl@0
  1370
The available values are as follows:
sl@0
  1371
@code
sl@0
  1372
 _SC_ARG_MAX
sl@0
  1373
  The maximum number of argument to execve.
sl@0
  1374
 _SC_CHILD_MAX
sl@0
  1375
  The maximum number of simultaneous processes per user id.(Not supported)
sl@0
  1376
 _SC_CLK_TCK
sl@0
  1377
  The frequency of the statistics clock in ticks per second.
sl@0
  1378
 _SC_IOV_MAX
sl@0
  1379
  The maximum number of elements in the I/O vector used by readv , writev , recvmsg ,
sl@0
  1380
 and sendmsg .
sl@0
  1381
 _SC_NGROUPS_MAX
sl@0
  1382
  The maximum number of supplemental groups.(Not supported)
sl@0
  1383
 _SC_NPROCESSORS_CONF
sl@0
  1384
  The number of processors configured.(Not supported)
sl@0
  1385
 _SC_NPROCESSORS_ONLN
sl@0
  1386
  The number of processors currently online.(Not supported)
sl@0
  1387
 _SC_OPEN_MAX
sl@0
  1388
  The maximum number of open files per user id.(Not supported)
sl@0
  1389
 _SC_STREAM_MAX
sl@0
  1390
  The minimum maximum number of streams that a process may have open( Not supported)
sl@0
  1391
 at any one time.
sl@0
  1392
 _SC_TZNAME_MAX
sl@0
  1393
  The minimum maximum number of types supported for the name of a
sl@0
  1394
 timezone.(Not supported)
sl@0
  1395
 _SC_JOB_CONTROL
sl@0
  1396
  Return 1 if job control is available on this system, otherwise -1.
sl@0
  1397
 _SC_SAVED_IDS
sl@0
  1398
  Returns 1 if saved set-group and saved set-user ID is available,
sl@0
  1399
 otherwise -1.(Not supported)
sl@0
  1400
 _SC_VERSION
sl@0
  1401
  The version of -p1003.1 with which the system
sl@0
  1402
 attempts to comply.(Not supported)
sl@0
  1403
 _SC_BC_BASE_MAX
sl@0
  1404
  The maximum ibase/obase values in the bc utility.(Not supported)
sl@0
  1405
 _SC_BC_DIM_MAX
sl@0
  1406
  The maximum array size in the bc utility.(Not supported)
sl@0
  1407
 _SC_BC_SCALE_MAX
sl@0
  1408
  The maximum scale value in the bc utility.(Not supported)
sl@0
  1409
 _SC_BC_STRING_MAX
sl@0
  1410
  The maximum string length in the bc utility.(Not supported)
sl@0
  1411
 _SC_COLL_WEIGHTS_MAX
sl@0
  1412
  The maximum number of weights that can be assigned to any entry of
sl@0
  1413
 the LC_COLLATE order keyword in the locale definition file.(Not supported)
sl@0
  1414
 _SC_EXPR_NEST_MAX
sl@0
  1415
  The maximum number of expressions that can be nested within
sl@0
  1416
 parenthesis by the expr utility.(Not supported)
sl@0
  1417
 _SC_LINE_MAX
sl@0
  1418
  The maximum length in bytes of a text-processing utility's input
sl@0
  1419
 line.(Not supported)
sl@0
  1420
 _SC_RE_DUP_MAX
sl@0
  1421
  The maximum number of repeated occurrences of a regular expression
sl@0
  1422
 permitted when using interval notation.(Not supported)
sl@0
  1423
 _SC_2_VERSION
sl@0
  1424
  The version of -p1003.2 with which the system attempts to comply.( Not supported)
sl@0
  1425
 _SC_2_C_BIND
sl@0
  1426
  Return 1 if the system's C-language development facilities support the
sl@0
  1427
 C-Language Bindings Option, otherwise -1.
sl@0
  1428
 _SC_2_C_DEV
sl@0
  1429
  Return 1 if the system supports the C-Language Development Utilities Option,
sl@0
  1430
 otherwise -1.
sl@0
  1431
 _SC_2_CHAR_TERM
sl@0
  1432
  Return 1 if the system supports at least one terminal type capable of
sl@0
  1433
 all operations described in -p1003.2 ,
sl@0
  1434
 otherwise -1.
sl@0
  1435
 _SC_2_FORT_DEV
sl@0
  1436
  Return 1 if the system supports the FORTRAN Development Utilities Option,
sl@0
  1437
 otherwise -1.
sl@0
  1438
 _SC_2_FORT_RUN
sl@0
  1439
  Return 1 if the system supports the FORTRAN Runtime Utilities Option,
sl@0
  1440
 otherwise -1.
sl@0
  1441
 _SC_2_LOCALEDEF
sl@0
  1442
  Return 1 if the system supports the creation of locales, otherwise -1.
sl@0
  1443
 _SC_2_SW_DEV
sl@0
  1444
  Return 1 if the system supports the Software Development Utilities Option,
sl@0
  1445
 otherwise -1.
sl@0
  1446
 _SC_2_UPE
sl@0
  1447
  Return 1 if the system supports the User Portability Utilities Option,
sl@0
  1448
 otherwise -1.
sl@0
  1449
 _SC_PAGESIZE
sl@0
  1450
  Returns size of a page in bytes.  (Some systems use PAGE_SIZE instead.)
sl@0
  1451
@endcode
sl@0
  1452
sl@0
  1453
 Note: Some of the  return values may not be posix compliant.
sl@0
  1454
sl@0
  1455
Examples:
sl@0
  1456
@code
sl@0
  1457
/*
sl@0
  1458
 *  Detailed description  : This test code demonstrates usage of sysconf system call , here it get max command
sl@0
  1459
    line arguments that can be passed to process.
sl@0
  1460
*/
sl@0
  1461
#include <unistd.h>
sl@0
  1462
int main()
sl@0
  1463
{
sl@0
  1464
  int ret = 0 ;
sl@0
  1465
  ret = sysconf(_SC_ARG_MAX) ;
sl@0
  1466
  if(ret < 0 )  {
sl@0
  1467
    printf("Sysconf call failed") ;
sl@0
  1468
    return -1 ;
sl@0
  1469
 }
sl@0
  1470
 printf("Max command line arguments = %d" , ret) ;
sl@0
  1471
 return 0 ;
sl@0
  1472
}
sl@0
  1473
sl@0
  1474
@endcode
sl@0
  1475
 Output
sl@0
  1476
@code
sl@0
  1477
max-number of commandline args supproted by system.
sl@0
  1478
sl@0
  1479
@endcode
sl@0
  1480
@see pathconf()
sl@0
  1481
@see confstr()
sl@0
  1482
sl@0
  1483
sl@0
  1484
Bugs:
sl@0
  1485
sl@0
  1486
 The value for _SC_STREAM_MAX is a minimum maximum, and is required to be 
sl@0
  1487
the same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously small 
sl@0
  1488
and misleading number. 
sl@0
  1489
sl@0
  1490
 
sl@0
  1491
sl@0
  1492
@publishedAll
sl@0
  1493
@externallyDefinedApi
sl@0
  1494
*/
sl@0
  1495
sl@0
  1496
/** @fn  unlink(const char *pathname)
sl@0
  1497
@param pathname
sl@0
  1498
@return   Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
sl@0
  1499
sl@0
  1500
 
sl@0
  1501
 The unlink system call removes the link named by pathname from its file system.
sl@0
  1502
sl@0
  1503
 Symbian OS simulates links so there is no reference count and files are unaware 
sl@0
  1504
  of links. Calling unlink on a file will always close the file, regardless of 
sl@0
  1505
  whether there is another link.
sl@0
  1506
sl@0
  1507
 The pathname argument may not be a directory.
sl@0
  1508
sl@0
  1509
Examples:
sl@0
  1510
@code
sl@0
  1511
/*
sl@0
  1512
 * Detailed description  : Example to unlink a link file
sl@0
  1513
 * Precondition : A link file by name "Link" should exist in
sl@0
  1514
 *                c: drive.
sl@0
  1515
 */
sl@0
  1516
#include <unistd.h>
sl@0
  1517
#include <stdio.h>
sl@0
  1518
int main(void)
sl@0
  1519
{
sl@0
  1520
    char rdbuff[25];
sl@0
  1521
    if(unlink("C:\Link"))
sl@0
  1522
    {
sl@0
  1523
         printf("unlink on link file failed");
sl@0
  1524
    }
sl@0
  1525
    printf("Unlink on link file succeeded");
sl@0
  1526
}
sl@0
  1527
sl@0
  1528
@endcode
sl@0
  1529
 Output
sl@0
  1530
@code
sl@0
  1531
Unlink on link file succeeded.
sl@0
  1532
sl@0
  1533
@endcode
sl@0
  1534
sl@0
  1535
Limitations:
sl@0
  1536
sl@0
  1537
- The path parameter of the unlink() function should not exceed 256 characters in length. 
sl@0
  1538
- P.I.P.S. only simulates link files and does not distinguish between hard and symbolic links.
sl@0
  1539
- KErrNotReady of Symbian error code is mapped to ENOENT, which typically means drive
sl@0
  1540
not found or filesystem not mounted on the drive.
sl@0
  1541
sl@0
  1542
@see close()
sl@0
  1543
@see link()
sl@0
  1544
@see rmdir()
sl@0
  1545
@see symlink()
sl@0
  1546
sl@0
  1547
sl@0
  1548
sl@0
  1549
@capability Deferred @ref RFs::Att(const TDesC16&, unsigned&)
sl@0
  1550
@capability Deferred @ref RFs::SetAtt(const TDesC16&, unsigned, unsigned)
sl@0
  1551
@capability Deferred @ref RFs::Delete(const TDesC16&)
sl@0
  1552
sl@0
  1553
@publishedAll
sl@0
  1554
@externallyDefinedApi
sl@0
  1555
*/
sl@0
  1556
sl@0
  1557
/** @fn  write(int fd, const void *buf, size_t cnt)
sl@0
  1558
@param fd
sl@0
  1559
@param buf
sl@0
  1560
@param cnt
sl@0
  1561
sl@0
  1562
@return   Upon successful completion the number of bytes which were written
sl@0
  1563
is returned.
sl@0
  1564
Otherwise a -1 is returned and the global variable errno is set to indicate the error.
sl@0
  1565
sl@0
  1566
The write system call attempts to write cnt bytes of data to the object referenced by the descriptor fd from the buffer pointed to by buf .
sl@0
  1567
The writev system call performs the same action, but gathers the output data from the iovcnt buffers specified by the members of the iov array: iov[0], iov[1], ..., iov[iovcnt-1].
sl@0
  1568
The pwrite and pwritev system calls perform the same functions, but write to the specified position in the file without modifying the file pointer.
sl@0
  1569
sl@0
  1570
Notes: 
sl@0
  1571
sl@0
  1572
1. This description also covers the pwrite(), writev() and pwritev() functions.
sl@0
  1573
 
sl@0
  1574
2. An attempt to write on a broken pipe generates the SIGPIPE signal, which may cause termination of the process, if it is not handled.
sl@0
  1575
sl@0
  1576
 For writev and pwritev, the iovec structure is defined as:
sl@0
  1577
sl@0
  1578
@code
sl@0
  1579
 struct iovec {
sl@0
  1580
void   *iov_base;  //Base address.
sl@0
  1581
size_t iov_len;    // Length.
sl@0
  1582
};
sl@0
  1583
@endcode
sl@0
  1584
sl@0
  1585
 Each iovec entry specifies the base address and length of an area
sl@0
  1586
in memory from which data should be written.
sl@0
  1587
The writev system call
sl@0
  1588
will always write a complete area before proceeding
sl@0
  1589
to the next.
sl@0
  1590
sl@0
  1591
 On objects capable of seeking, the write starts at a position
sl@0
  1592
given by the pointer associated with fd ,
sl@0
  1593
see lseek .
sl@0
  1594
Upon return from write ,
sl@0
  1595
the pointer is incremented by the number of bytes which were written.
sl@0
  1596
sl@0
  1597
If 'fd' refers to a shared memory object then write() on the shared memory object is supported by the current implementation.
sl@0
  1598
sl@0
  1599
 Objects that are not capable of seeking always write from the current
sl@0
  1600
position.
sl@0
  1601
The value of the pointer associated with such an object
sl@0
  1602
is undefined.
sl@0
  1603
sl@0
  1604
 When using non-blocking I/O on objects such as sockets that are subject
sl@0
  1605
to flow control, write and writev may write fewer bytes than requested;
sl@0
  1606
the return value must be noted,
sl@0
  1607
and the remainder of the operation should be retried when possible.
sl@0
  1608
sl@0
  1609
Examples:
sl@0
  1610
@code
sl@0
  1611
/* Detailed description: This sample code creates an Example.txt file in the current working
sl@0
  1612
 * directory(if file existes then it is truncated) and writes "Hello World" string
sl@0
  1613
 * to the file.
sl@0
  1614
 *
sl@0
  1615
 * Preconditions: Example.txt if present, it should not be read-only.
sl@0
  1616
 */
sl@0
  1617
int main()
sl@0
  1618
{
sl@0
  1619
 int fd = 0 ;
sl@0
  1620
 char Buf[] = "Hello World" ;
sl@0
  1621
 fd = open("Example.txt" , O_CREAT | O_TRUNC | O_RDWR  ,0666) ;
sl@0
  1622
 if(fd < 0 )
sl@0
  1623
 {
sl@0
  1624
    printf("Failed to open file Example.txt") ;
sl@0
  1625
    return -1 ;
sl@0
  1626
 }
sl@0
  1627
 if(write(fd , Buf , sizeof(Buf)) < sizeof(Buf))
sl@0
  1628
  {
sl@0
  1629
    printf("Failed to write string %s to file" , Buf) ;
sl@0
  1630
    return -1 ;
sl@0
  1631
  }
sl@0
  1632
  printf("String %s written to file 
sl@0
  1633
" , Buf) ;
sl@0
  1634
  return 0 ;
sl@0
  1635
 }
sl@0
  1636
sl@0
  1637
@endcode
sl@0
  1638
 Output
sl@0
  1639
@code
sl@0
  1640
String Hello World written to file
sl@0
  1641
sl@0
  1642
@endcode
sl@0
  1643
@code
sl@0
  1644
/*
sl@0
  1645
 * Detailed description  : Sample usage of readv system call
sl@0
  1646
 */
sl@0
  1647
#include <stdio.h>
sl@0
  1648
#include <sys/types.h>
sl@0
  1649
#include <sys/uio.h>
sl@0
  1650
#include <fcntl.h>
sl@0
  1651
int main()
sl@0
  1652
{
sl@0
  1653
  int fd = 0 ;
sl@0
  1654
  struct iovec io_vec[1] ;
sl@0
  1655
  char Buf[12] = "Hello world" ;
sl@0
  1656
  io_vec[0].iov_base  = Buf ;
sl@0
  1657
  io_vec[0].iov_len = 11 ;
sl@0
  1658
  fd = open("Example.txt" , O_CREAT | O_RDWR , 0666 ) ;
sl@0
  1659
  if(fd < 0 )  {
sl@0
  1660
    printf("File open failed") ;
sl@0
  1661
    return -1 ;
sl@0
  1662
  }
sl@0
  1663
  if(writev(fd , io_vec , 1) <  11 )   {
sl@0
  1664
    printf("Failed to read fron Example.txt file") ;
sl@0
  1665
    return -1 ;
sl@0
  1666
  }
sl@0
  1667
  printf("writev succes %s written"  , io_vec[0].iov_base) ;
sl@0
  1668
  return 0 ; }
sl@0
  1669
sl@0
  1670
@endcode
sl@0
  1671
 Output
sl@0
  1672
@code
sl@0
  1673
writev succes Hello world written
sl@0
  1674
sl@0
  1675
@endcode
sl@0
  1676
@see fcntl()
sl@0
  1677
@see lseek()
sl@0
  1678
@see open()
sl@0
  1679
@see pipe()
sl@0
  1680
@see select()
sl@0
  1681
sl@0
  1682
sl@0
  1683
 
sl@0
  1684
sl@0
  1685
@publishedAll
sl@0
  1686
@externallyDefinedApi
sl@0
  1687
*/
sl@0
  1688
sl@0
  1689
/** @fn  confstr(int name, char *buf, size_t len)
sl@0
  1690
@param name
sl@0
  1691
@param buf
sl@0
  1692
@param len
sl@0
  1693
@return   If the call to confstr is not successful, 0 is returned and errno is set appropriately.
sl@0
  1694
Otherwise, if the variable does not have a configuration defined value,
sl@0
  1695
0 is returned and errno is not modified.
sl@0
  1696
Otherwise, the buffer size needed to hold the entire configuration-defined
sl@0
  1697
value is returned.
sl@0
  1698
If this size is greater than the argument len, the string in buf was truncated.
sl@0
  1699
sl@0
  1700
  The confstr function provides a method for applications to get configuration
sl@0
  1701
defined string values.
sl@0
  1702
sl@0
  1703
The name argument specifies the system variable to be queried. Symbolic 
sl@0
  1704
  constants for each name value are found in the include file \#include \<unistd.h.\> The len argument specifies the size of the buffer referenced by the argument buf. If len is non-zero, buf is a non-null pointer, and name has a value, up to len - 1 bytes of the value are copied into the buffer buf. The copied value is always null terminated.
sl@0
  1705
 The available values are as follows:
sl@0
  1706
sl@0
  1707
@code
sl@0
  1708
 _CS_PATH
sl@0
  1709
  Return a value for the PATH environment variable that finds all the standard utilities.
sl@0
  1710
sl@0
  1711
@endcode
sl@0
  1712
sl@0
  1713
Examples:
sl@0
  1714
@code
sl@0
  1715
#include<unistd.h>
sl@0
  1716
#include<stdio.h>
sl@0
  1717
#include <stdlib.h>
sl@0
  1718
 
sl@0
  1719
int main()
sl@0
  1720
{
sl@0
  1721
 int n = 0;
sl@0
  1722
 char *buf = NULL;
sl@0
  1723
 int len = 0;
sl@0
  1724
   
sl@0
  1725
 n = confstr(_CS_PATH, NULL, 0);
sl@0
  1726
    
sl@0
  1727
 printf("{Expected: 31} %d", n);
sl@0
  1728
       
sl@0
  1729
 if( n == 0 )
sl@0
  1730
    return -1;
sl@0
  1731
                    
sl@0
  1732
 buf = (char *)malloc(n);
sl@0
  1733
  
sl@0
  1734
 if ( buf == NULL )
sl@0
  1735
 {
sl@0
  1736
    printf("malloc failed!!");
sl@0
  1737
    return -1;
sl@0
  1738
 }
sl@0
  1739
             
sl@0
  1740
 len = confstr(_CS_PATH, buf, n);
sl@0
  1741
                
sl@0
  1742
 printf("PATH in buffer: \n%s", buf);
sl@0
  1743
 printf("length: %d", len);
sl@0
  1744
 free(buf);
sl@0
  1745
 
sl@0
  1746
 return 0;
sl@0
  1747
}
sl@0
  1748
sl@0
  1749
@endcode
sl@0
  1750
 Output
sl@0
  1751
@code
sl@0
  1752
PATH in buffer:
sl@0
  1753
/usr/bin:/bin:/usr/sbin:/sbin:
sl@0
  1754
length: 31
sl@0
  1755
sl@0
  1756
@endcode
sl@0
  1757
@see pathconf()
sl@0
  1758
@see sysconf()
sl@0
  1759
sl@0
  1760
sl@0
  1761
 
sl@0
  1762
sl@0
  1763
@publishedAll
sl@0
  1764
@externallyDefinedApi
sl@0
  1765
*/
sl@0
  1766
sl@0
  1767
/** @fn getopt(int nargc, char * const nargv[], const char *ostr)
sl@0
  1768
@param nargc
sl@0
  1769
@param nargv
sl@0
  1770
@param ostr
sl@0
  1771
@return The  getopt function returns the next known option character in  optstring. If  getopt encounters a character not found in  optstring or if it detects a missing option argument, it returns ‘?’ (question mark. If  optstring has a leading ‘:’ then a missing option argument causes ‘:’ to be returned instead of ‘?.’ In either case, the variable  optopt is set to the character that caused the error. The  getopt function returns -1 when the argument list is exhausted.
sl@0
  1772
sl@0
  1773
The  getopt function incrementally parses a command line argument list  argv and returns the next  known option character. An option character is  known if it has been specified in the string of accepted option characters,  optstring.
sl@0
  1774
sl@0
  1775
The option string optstring may contain the following elements: individual characters, and characters followed by a colon to indicate an option argument is to follow. For example, an option string x recognizes an option "-x", and an option string x: recognizes an option and argument "-x argument." It does not matter to getopt if a following argument has leading white space.
sl@0
  1776
sl@0
  1777
On return from getopt, optarg points to an option argument, if it is anticipated, and the variable optind contains the index to the next argv argument for a subsequent call to getopt. The variable optopt saves the last known option character returned by getopt.
sl@0
  1778
sl@0
  1779
The variables opterr and optind are both initialized to 1. The optind variable may be set to another value before a set of calls to getopt in order to skip over more or less argv entries.
sl@0
  1780
sl@0
  1781
In order to use getopt to evaluate multiple sets of arguments, or to evaluate a single set of arguments multiple times, the variable optreset must be set to 1 before the second and each additional set of calls to getopt, and the variable optind must be reinitialized.
sl@0
  1782
sl@0
  1783
The getopt function returns -1 when the argument list is exhausted. The interpretation of options in the argument list may be cancelled by the option ‘--’ (double dash) which causes getopt to signal the end of argument processing and return -1. When all options have been processed (i.e., up to the first non-option argument), getopt returns -1. 
sl@0
  1784
sl@0
  1785
Examples:
sl@0
  1786
@code
sl@0
  1787
#include <unistd.h>
sl@0
  1788
#include <stdio.h>
sl@0
  1789
#include <fcntl.h>
sl@0
  1790
#include <errno.h>
sl@0
  1791
#include <string.h>
sl@0
  1792
 
sl@0
  1793
int main()
sl@0
  1794
{
sl@0
  1795
        int argc = 3;
sl@0
  1796
         
sl@0
  1797
        char *argv[] =
sl@0
  1798
         {
sl@0
  1799
                 "getopt","-f","hi"
sl@0
  1800
         };
sl@0
  1801
        
sl@0
  1802
        int bflag, ch, fd;
sl@0
  1803
        bflag = 0;
sl@0
  1804
         
sl@0
  1805
        while ((ch = getopt(argc, argv, "bf:")) != -1) {
sl@0
  1806
        
sl@0
  1807
        switch (ch) {
sl@0
  1808
        case 'b':
sl@0
  1809
                bflag = 1;
sl@0
  1810
                printf("option is 'b' \n");
sl@0
  1811
                break;
sl@0
  1812
        case 'f':
sl@0
  1813
                printf("option is 'f' \n");
sl@0
  1814
                if ((fd = open(optarg, O_RDONLY, 0)) != 0) {
sl@0
  1815
                        (void)fprintf(stderr,
sl@0
  1816
                           "myname: %s: %s\n", optarg, strerror(errno));                
sl@0
  1817
                }                             
sl@0
  1818
                break;
sl@0
  1819
        case '?':
sl@0
  1820
                printf("missing option!");
sl@0
  1821
        default:
sl@0
  1822
                printf("unknown option!");
sl@0
  1823
        }
sl@0
  1824
       
sl@0
  1825
}
sl@0
  1826
argc -= optind;
sl@0
  1827
return 0;
sl@0
  1828
}
sl@0
  1829
sl@0
  1830
@endcode
sl@0
  1831
 Output
sl@0
  1832
@code
sl@0
  1833
option is ’f’
sl@0
  1834
myname: hi: No such file or directory
sl@0
  1835
@endcode
sl@0
  1836
@see getopt_long()
sl@0
  1837
sl@0
  1838
Bugs:
sl@0
  1839
sl@0
  1840
The  getopt function was once specified to return  EOF instead of -1. This was changed by  -p1003.2-92 to decouple  getopt from
sl@0
  1841
 	\#include \<stdio.h\>
sl@0
  1842
sl@0
  1843
A single dash "-" may be specified as a character in optstring, however it should never have an argument associated with it. This allows getopt to be used with programs that expect "-" as an option flag. This practice is wrong, and should not be used in any current development. It is provided for backward compatibility only. Care should be taken not to use ‘-’ as the first character in optstring to avoid a semantic conflict with GNU getopt, which assigns different meaning to an optstring that begins with a ‘-.’ By default, a single dash causes getopt to return -1.
sl@0
  1844
sl@0
  1845
It is also possible to handle digits as option letters. This allows getopt to be used with programs that expect a number ("-3") as an option. This practice is wrong, and should not be used in any current development. It is provided for backward compatibility only. The following code fragment works in most cases.
sl@0
  1846
sl@0
  1847
@code
sl@0
  1848
int ch;
sl@0
  1849
long length;
sl@0
  1850
char *p, *ep;
sl@0
  1851
while ((ch = getopt(argc, argv, "0123456789")) != -1)
sl@0
  1852
        switch (ch) {
sl@0
  1853
        case ’0’: case ’1’: case ’2’: case ’3’: case ’4’:
sl@0
  1854
        case ’5’: case ’6’: case ’7’: case ’8’: case ’9’:
sl@0
  1855
                p = argv[optind - 1];
sl@0
  1856
                if (p[0] == ’-’ Am]Am] p[1] == ch Am]Am] !p[2]) {
sl@0
  1857
                        length = ch - ’0’;
sl@0
  1858
                        ep = "";
sl@0
  1859
                } else if (argv[optind] Am]Am] argv[optind][1] == ch) {
sl@0
  1860
                        length = strtol((p = argv[optind] + 1),
sl@0
  1861
                            Am]ep, 10);
sl@0
  1862
                        optind++;
sl@0
  1863
                        optreset = 1;
sl@0
  1864
                } else
sl@0
  1865
                        usage();
sl@0
  1866
                if (*ep != ’\0’)
sl@0
  1867
                        errx(EX_USAGE, "illegal number -- %s", p);
sl@0
  1868
                break;
sl@0
  1869
        }
sl@0
  1870
@endcode
sl@0
  1871
sl@0
  1872
 
sl@0
  1873
sl@0
  1874
@publishedAll
sl@0
  1875
@externallyDefinedApi
sl@0
  1876
*/
sl@0
  1877
sl@0
  1878
/** @fn  fsync(int fd)
sl@0
  1879
@param fd
sl@0
  1880
@return   Upon successful completion, fsync() returns 0. Otherwise, it returns -1 and sets 
sl@0
  1881
errno to indicate the error. If the fsync() function fails, outstanding I/O operations 
sl@0
  1882
are not guaranteed to have been completed.
sl@0
  1883
sl@0
  1884
  The fsync system call
sl@0
  1885
causes all modified data and attributes of fd to be moved to a permanent storage device.
sl@0
  1886
This normally results in all in-core modified copies
sl@0
  1887
of buffers for the associated file to be written to a disk.
sl@0
  1888
sl@0
  1889
 The fsync system call should be used by programs that require a file to 
sl@0
  1890
  be in a known state, for example, when building a simple transaction facility.
sl@0
  1891
sl@0
  1892
Examples:
sl@0
  1893
@code
sl@0
  1894
/*
sl@0
  1895
 * Detailed description : Simple usage of fsync system call.
sl@0
  1896
 * Preconditions : Example.txt if present should not a ready-only file
sl@0
  1897
 */
sl@0
  1898
#include <unistd.h>
sl@0
  1899
#include <fcntl.h>
sl@0
  1900
int main()
sl@0
  1901
{
sl@0
  1902
  int fd = 0;
sl@0
  1903
  fd = open("Example.txt" , O_CREAT | O_RDWR , 0666);
sl@0
  1904
  if(fd < 0 )  
sl@0
  1905
  {
sl@0
  1906
     printf("Failed to open file Example.txt");
sl@0
  1907
     return -1;
sl@0
  1908
  }
sl@0
  1909
  if(fsync(fd) < 0 )  
sl@0
  1910
  {
sl@0
  1911
     printf("fsync system call failed");
sl@0
  1912
     return -1;
sl@0
  1913
  }
sl@0
  1914
  close(fd);
sl@0
  1915
  printf("fsync system call succeeded");
sl@0
  1916
  return 0;
sl@0
  1917
}
sl@0
  1918
sl@0
  1919
@endcode
sl@0
  1920
 Output
sl@0
  1921
@code
sl@0
  1922
fsync system call succeeded
sl@0
  1923
sl@0
  1924
@endcode
sl@0
  1925
@see fsync()
sl@0
  1926
@see sync()
sl@0
  1927
sl@0
  1928
sl@0
  1929
 
sl@0
  1930
sl@0
  1931
@publishedAll
sl@0
  1932
@externallyDefinedApi
sl@0
  1933
*/
sl@0
  1934
sl@0
  1935
/** @fn  fdatasync(int filedesc)
sl@0
  1936
@param filedesc
sl@0
  1937
@return   If successful the function returns 0, otherwise it returns (-1) and sets errno 
sl@0
  1938
  to indicate the error.
sl@0
  1939
sl@0
  1940
  The fdatasync system call
sl@0
  1941
causes all modified data and attributes of fd to be moved to a permanent storage device.
sl@0
  1942
This normally results in all in-core modified copies
sl@0
  1943
of buffers for the associated file to be written to a disk.
sl@0
  1944
The fdatasync() function forces all the queued I/O operations associated that
sl@0
  1945
file, as indicated by the file descriptor fd, to the synchronized I/O completion
sl@0
  1946
state.
sl@0
  1947
sl@0
  1948
 The functionality shall be equivalent to fsync() with the symbol _POSIX_SYNCHRONIZED_IO 
sl@0
  1949
  defined. This has an exception that all I/O operations shall be completed before 
sl@0
  1950
  the call.
sl@0
  1951
sl@0
  1952
sl@0
  1953
sl@0
  1954
 The fdatasync should be used by programs that require a file to be in 
sl@0
  1955
  a known state, for example when building a simple transaction facility.
sl@0
  1956
sl@0
  1957
sl@0
  1958
sl@0
  1959
Examples:
sl@0
  1960
@code
sl@0
  1961
#include<unistd.h>
sl@0
  1962
#include<stdio.h>
sl@0
  1963
#define KMAXCHARS 100
sl@0
  1964
int test_fdatasync()
sl@0
  1965
{
sl@0
  1966
   char* array = "abcdefghijklmnopqrstuvwxyz";
sl@0
  1967
   struct stat buf;
sl@0
  1968
   if((fd = open(file , O_CREAT | O_RDWR , 0666))  < 0)
sl@0
  1969
   {
sl@0
  1970
      printf("Failed  to create file");
sl@0
  1971
   }
sl@0
  1972
   size_t size = write(fd,array, KMAXCHARS);
sl@0
  1973
   if(fdatasync(fd) < 0)
sl@0
  1974
   {
sl@0
  1975
     printf("Fdatasync failed");
sl@0
  1976
     int retrn = remove(file);
sl@0
  1977
     return -1;
sl@0
  1978
   }
sl@0
  1979
  int retVal2 = fstat( fp, &buf; );
sl@0
  1980
  if(!retVal2)
sl@0
  1981
  {
sl@0
  1982
    size_t bufsize = buf.st_size;
sl@0
  1983
    if (bufsize == size)
sl@0
  1984
    {
sl@0
  1985
      printf("file size = %d", size);
sl@0
  1986
      printf("Fdatasync passed");
sl@0
  1987
      int retrn = remove(file);
sl@0
  1988
      return 0;
sl@0
  1989
    }
sl@0
  1990
  }
sl@0
  1991
}
sl@0
  1992
sl@0
  1993
@endcode
sl@0
  1994
 Output
sl@0
  1995
@code
sl@0
  1996
file size = 50
sl@0
  1997
Fdatasync passed
sl@0
  1998
sl@0
  1999
@endcode
sl@0
  2000
@see sync()
sl@0
  2001
@see fsync()
sl@0
  2002
sl@0
  2003
sl@0
  2004
 
sl@0
  2005
sl@0
  2006
@publishedAll
sl@0
  2007
@externallyDefinedApi
sl@0
  2008
*/
sl@0
  2009
sl@0
  2010
/** @fn ftruncate(int filedesc, off_t length)
sl@0
  2011
@param filedesc
sl@0
  2012
@param length
sl@0
  2013
sl@0
  2014
Refer to truncate() for documentation
sl@0
  2015
sl@0
  2016
@see open()
sl@0
  2017
@publishedAll
sl@0
  2018
@externallyDefinedApi
sl@0
  2019
*/
sl@0
  2020
sl@0
  2021
/** @fn ftruncate64(int filedesc, off64_t length)
sl@0
  2022
@param filedesc
sl@0
  2023
@param length
sl@0
  2024
sl@0
  2025
For full documentation see: http://www.unix.org/version2/whatsnew/lfs20mar.html#3.0
sl@0
  2026
sl@0
  2027
@see ftruncate()
sl@0
  2028
sl@0
  2029
@publishedAll
sl@0
  2030
@externallyDefinedApi
sl@0
  2031
*/
sl@0
  2032
sl@0
  2033
/** @fn  readlink(const char *path, char *buf, int bufsize)
sl@0
  2034
@param path
sl@0
  2035
@param buf
sl@0
  2036
@param bufsize
sl@0
  2037
@return   The call returns the count of characters placed in the buffer
sl@0
  2038
if it succeeds, or a -1 if an error occurs, placing the error
sl@0
  2039
code in the global variable errno.
sl@0
  2040
sl@0
  2041
  The readlink system call
sl@0
  2042
places the contents of the symbolic link path in the buffer buf, which has size bufsize. The readlink system call does not append a NULL character to buf.
sl@0
  2043
sl@0
  2044
Examples:
sl@0
  2045
@code
sl@0
  2046
/*
sl@0
  2047
* Detailed description: Example to read a link file
sl@0
  2048
* Precondition: "Parent.txt" should exist in c: drive with some contents
sl@0
  2049
*                of length atleast 25 characters.  And a link file by name           
sl@0
  2050
*                "C:\Link" pointing to parent file should exist.
sl@0
  2051
*
sl@0
  2052
*/
sl@0
  2053
#include <unistd.h>
sl@0
  2054
#include <stdio.h>
sl@0
  2055
int main(void)
sl@0
  2056
{
sl@0
  2057
    char rdbuff[25];
sl@0
  2058
    int retval;
sl@0
  2059
   if((retval = (readlink("C:\Link", rdbuff, (sizeof(char)*25)))) < 0)
sl@0
  2060
    {
sl@0
  2061
       printf("Read through link file failed");
sl@0
  2062
       perror(" ");
sl@0
  2063
       return -1;
sl@0
  2064
    }
sl@0
  2065
    printf("Read through link file succeeded");
sl@0
  2066
}
sl@0
  2067
sl@0
  2068
@endcode
sl@0
  2069
 Output
sl@0
  2070
@code
sl@0
  2071
Read through link file succeeded.
sl@0
  2072
sl@0
  2073
@endcode
sl@0
  2074
sl@0
  2075
Limitations:
sl@0
  2076
sl@0
  2077
The path parameter of the readlink() function should not exceed 256 characters in length. 
sl@0
  2078
sl@0
  2079
@see lstat()
sl@0
  2080
@see stat()
sl@0
  2081
@see symlink()
sl@0
  2082
@see symlink()
sl@0
  2083
sl@0
  2084
sl@0
  2085
sl@0
  2086
@capability Deferred @ref RFs::Entry(const TDesC16&, TEntry&)
sl@0
  2087
sl@0
  2088
@publishedAll
sl@0
  2089
@externallyDefinedApi
sl@0
  2090
*/
sl@0
  2091
sl@0
  2092
/** @fn gethostname(char *name, size_t size)
sl@0
  2093
@param name
sl@0
  2094
@param size
sl@0
  2095
@return On successful completion, 0 is returned. Otherwise, -1 is returned
sl@0
  2096
sl@0
  2097
The gethostname() function returns the standard host name for the current machine. The size argument specifies the size of the array pointed to by the name argument. The returned name is null-terminated, except that if size is an insufficient length to hold the host name, then the returned name is truncated and it is unspecified whether the returned name is null-terminated. 
sl@0
  2098
Host names are limited to 255 bytes
sl@0
  2099
sl@0
  2100
@see uname()
sl@0
  2101
sl@0
  2102
@publishedAll
sl@0
  2103
@externallyDefinedApi
sl@0
  2104
*/
sl@0
  2105
sl@0
  2106
/** @fn  setegid(gid_t gid)
sl@0
  2107
@param gid
sl@0
  2108
sl@0
  2109
Refer to  setuid() for the documentation
sl@0
  2110
sl@0
  2111
sl@0
  2112
 
sl@0
  2113
sl@0
  2114
@publishedAll
sl@0
  2115
@externallyDefinedApi
sl@0
  2116
*/
sl@0
  2117
sl@0
  2118
/** @fn  seteuid(uid_t uid)
sl@0
  2119
@param uid
sl@0
  2120
sl@0
  2121
Refer to  setuid() for the documentation
sl@0
  2122
sl@0
  2123
sl@0
  2124
 
sl@0
  2125
sl@0
  2126
@publishedAll
sl@0
  2127
@externallyDefinedApi
sl@0
  2128
*/
sl@0
  2129
sl@0
  2130
/** @fn  symlink(const char *oldpath, const char *newpath)
sl@0
  2131
@param oldpath
sl@0
  2132
@param newpath
sl@0
  2133
@return   Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno set to indicate the error.
sl@0
  2134
sl@0
  2135
 
sl@0
  2136
sl@0
  2137
 A symbolic link newpath is created to oldpath (newpath is the name of the file created, oldpath is the string used in creating the symbolic link). Either name 
sl@0
  2138
  may be an arbitrary path name. 
sl@0
  2139
sl@0
  2140
 The creation time stamp is not supported, only access and modification time 
sl@0
  2141
  stamps. Creating a link in a directory will not alter the time stamps of the 
sl@0
  2142
  directory itself.
sl@0
  2143
sl@0
  2144
 
sl@0
  2145
sl@0
  2146
Examples:
sl@0
  2147
@code
sl@0
  2148
/*
sl@0
  2149
* Detailed description  : Example to create symlink to a file.
sl@0
  2150
* Precondition : "Parent.txt" should exist in c: drive.
sl@0
  2151
* Remarks      : Symlink behaviour is exactly similar to link api.
sl@0
  2152
*/
sl@0
  2153
#include <unistd.h>
sl@0
  2154
#include <stdio.h>
sl@0
  2155
int main(void)
sl@0
  2156
 {
sl@0
  2157
    if(symlink("C:\Parent.txt","C:\Link") < 0)
sl@0
  2158
    {
sl@0
  2159
         printf("simulated link creation to parent file failed");
sl@0
  2160
         return -1  ;
sl@0
  2161
    }
sl@0
  2162
    printf("simulated link to parent file created");
sl@0
  2163
    return 0 ;
sl@0
  2164
 }
sl@0
  2165
sl@0
  2166
@endcode
sl@0
  2167
 Output
sl@0
  2168
@code
sl@0
  2169
simulated link to parent file created.
sl@0
  2170
sl@0
  2171
@endcode
sl@0
  2172
sl@0
  2173
Limitations:
sl@0
  2174
sl@0
  2175
- The oldpath and newpath parameters of the symlink() function should not exceed 256 characters in length. 
sl@0
  2176
- P.I.P.S. does not support links across file systems.
sl@0
  2177
- P.I.P.S. does not support symlink on directories or existing link files.
sl@0
  2178
- P.I.P.S. only simulates link files and does not distinguish between hard and symbolic links so link() and symlink() on P.I.P.S. are identical.
sl@0
  2179
- KErrNotReady of Symbian error code is mapped to ENOENT, which typically means drive
sl@0
  2180
not found or filesystem not mounted on the drive.
sl@0
  2181
sl@0
  2182
@see link()
sl@0
  2183
@see lstat()
sl@0
  2184
@see readlink()
sl@0
  2185
@see unlink()
sl@0
  2186
@see symlink()
sl@0
  2187
sl@0
  2188
sl@0
  2189
sl@0
  2190
@capability Deferred @ref RFs::Delete(const TDesC16&)
sl@0
  2191
sl@0
  2192
@publishedAll
sl@0
  2193
@externallyDefinedApi
sl@0
  2194
*/
sl@0
  2195
sl@0
  2196
/** @fn  fchdir(int filedesc)
sl@0
  2197
@param filedesc
sl@0
  2198
sl@0
  2199
Refer to  chdir() for the documentation
sl@0
  2200
sl@0
  2201
sl@0
  2202
sl@0
  2203
@capability Deferred @ref RFs::SetSessionPath(const TDesC16&)
sl@0
  2204
sl@0
  2205
@publishedAll
sl@0
  2206
@externallyDefinedApi
sl@0
  2207
*/
sl@0
  2208
sl@0
  2209
/** @fn  getpgid(pid_t pid)
sl@0
  2210
@param pid
sl@0
  2211
sl@0
  2212
Refer to  getpgrp() for the documentation
sl@0
  2213
sl@0
  2214
sl@0
  2215
 
sl@0
  2216
sl@0
  2217
@publishedAll
sl@0
  2218
@externallyDefinedApi
sl@0
  2219
*/
sl@0
  2220
sl@0
  2221
/** @fn  lchown(const char *path, uid_t owner, gid_t group)
sl@0
  2222
@param path
sl@0
  2223
@param owner
sl@0
  2224
@param group
sl@0
  2225
sl@0
  2226
Refer to  chown() for the documentation
sl@0
  2227
sl@0
  2228
sl@0
  2229
 
sl@0
  2230
sl@0
  2231
@publishedAll
sl@0
  2232
@externallyDefinedApi
sl@0
  2233
*/
sl@0
  2234
sl@0
  2235
/** @fn  nice(int incr)
sl@0
  2236
@param incr
sl@0
  2237
 
sl@0
  2238
sl@0
  2239
 The nice function obtains the scheduling priority of the process from 
sl@0
  2240
  the system and sets it to the priority value specified in incr. The priority is a value in the range -20 to 20. The default priority 
sl@0
  2241
  is 0. Lower priorities cause more favorable scheduling.
sl@0
  2242
sl@0
  2243
sl@0
  2244
sl@0
  2245
Examples:
sl@0
  2246
@code
sl@0
  2247
#include<unistd.h>
sl@0
  2248
#include<stdio.h>
sl@0
  2249
int test_nice()
sl@0
  2250
{
sl@0
  2251
   int retVal;
sl@0
  2252
   errno = 0;
sl@0
  2253
   int i = -10;
sl@0
  2254
   int ret_get1 = getpriority(PRIO_PROCESS,0);
sl@0
  2255
   retVal = nice(i);
sl@0
  2256
   int ret_get2 = getpriority(PRIO_PROCESS,0);
sl@0
  2257
   if((retVal == -1)&&(errno))
sl@0
  2258
   {
sl@0
  2259
      printf("failed");
sl@0
  2260
      return -1;
sl@0
  2261
   }
sl@0
  2262
   else
sl@0
  2263
   {
sl@0
  2264
     if(!(i - (ret_get2 - retget1)))
sl@0
  2265
     printf("Nice value: %d", i)
sl@0
  2266
     printf("nice passed");
sl@0
  2267
   }
sl@0
  2268
   return 0;
sl@0
  2269
}       
sl@0
  2270
sl@0
  2271
@endcode
sl@0
  2272
 Output
sl@0
  2273
@code
sl@0
  2274
Nice value: -10
sl@0
  2275
nice passed
sl@0
  2276
sl@0
  2277
@endcode
sl@0
  2278
@see getpriority()
sl@0
  2279
sl@0
  2280
sl@0
  2281
 
sl@0
  2282
sl@0
  2283
@publishedAll
sl@0
  2284
@externallyDefinedApi
sl@0
  2285
*/
sl@0
  2286
sl@0
  2287
/** @fn  setpgrp(pid_t _pid, pid_t _pgrp)
sl@0
  2288
@param _pid
sl@0
  2289
@param _pgrp
sl@0
  2290
sl@0
  2291
Refer to  setpgid() for the documentation
sl@0
  2292
sl@0
  2293
sl@0
  2294
 
sl@0
  2295
sl@0
  2296
@publishedAll
sl@0
  2297
@externallyDefinedApi
sl@0
  2298
*/
sl@0
  2299
sl@0
  2300
/** @fn  setregid(gid_t rgid, gid_t egid)
sl@0
  2301
@param rgid
sl@0
  2302
@param egid
sl@0
  2303
@return   These functions always return 0.
sl@0
  2304
sl@0
  2305
  These functions are build supported but not available functionally. Symbian 
sl@0
  2306
OS does not support multiple users and groups.
sl@0
  2307
sl@0
  2308
sl@0
  2309
sl@0
  2310
 
sl@0
  2311
sl@0
  2312
@publishedAll
sl@0
  2313
@externallyDefinedApi
sl@0
  2314
*/
sl@0
  2315
sl@0
  2316
/** @fn  setreuid(uid_t ruid, uid_t euid)
sl@0
  2317
@param ruid
sl@0
  2318
@param euid
sl@0
  2319
@return   These functions always return 0.
sl@0
  2320
sl@0
  2321
  These functions are build supported but not available functionally. Symbian 
sl@0
  2322
OS does not support multiple users and groups.
sl@0
  2323
sl@0
  2324
sl@0
  2325
sl@0
  2326
 
sl@0
  2327
sl@0
  2328
@publishedAll
sl@0
  2329
@externallyDefinedApi
sl@0
  2330
*/
sl@0
  2331
sl@0
  2332
/** @fn swab(const void *from, void *to, ssize_t len)
sl@0
  2333
@param from
sl@0
  2334
@param to
sl@0
  2335
@param len
sl@0
  2336
sl@0
  2337
The function  swab copies  len bytes from the location referenced by  from to the location referenced by  to, swapping adjacent bytes.
sl@0
  2338
sl@0
  2339
The argument len must be an even number.
sl@0
  2340
sl@0
  2341
Examples
sl@0
  2342
@code
sl@0
  2343
#include <string.h>
sl@0
  2344
#include <stdio.h>
sl@0
  2345
int main()
sl@0
  2346
{
sl@0
  2347
    int i=0x00003366,j=0x0;
sl@0
  2348
    swab((void *)&i,(void *)&j,2);
sl@0
  2349
    if(j==0x6633)
sl@0
  2350
       printf("Ouput val = %#x\n",j);
sl@0
  2351
    return 0;
sl@0
  2352
}
sl@0
  2353
@endcode
sl@0
  2354
sl@0
  2355
output
sl@0
  2356
@code
sl@0
  2357
Ouput val = 0x6633
sl@0
  2358
@endcode
sl@0
  2359
@see bzero()
sl@0
  2360
@see memset()
sl@0
  2361
sl@0
  2362
 
sl@0
  2363
sl@0
  2364
@publishedAll
sl@0
  2365
@externallyDefinedApi
sl@0
  2366
*/
sl@0
  2367
sl@0
  2368
/** @fn  usleep(useconds_t microseconds)
sl@0
  2369
@param microseconds
sl@0
  2370
@return   The usleep function returns the value 0 if successful; otherwise the value -1 is
sl@0
  2371
returned and the global variable errno is set to indicate the error.
sl@0
  2372
sl@0
  2373
  The usleep function suspends execution of the calling process until either microseconds microseconds have elapsed or a signal is delivered to the process and its
sl@0
  2374
action is to invoke a signal-catching function or to terminate the
sl@0
  2375
process.
sl@0
  2376
System activity may lengthen the sleep by an indeterminate amount.
sl@0
  2377
sl@0
  2378
 This function is implemented using nanosleep by pausing for microseconds microseconds or until a signal occurs.
sl@0
  2379
Consequently, in this implementation,
sl@0
  2380
sleeping has no effect on the state of process timers,
sl@0
  2381
and there is no special handling for SIGALRM.
sl@0
  2382
sl@0
  2383
Limitations:
sl@0
  2384
sl@0
  2385
The signal related functionaities aren’t applicable to the symbian implementation as there is no support for signals from symbian.
sl@0
  2386
sl@0
  2387
Examples:
sl@0
  2388
@code
sl@0
  2389
#include<unistd.h>
sl@0
  2390
#include<stdio.h>
sl@0
  2391
 
sl@0
  2392
int main()
sl@0
  2393
{
sl@0
  2394
 unsigned long t = 2; 
sl@0
  2395
 int i;
sl@0
  2396
  
sl@0
  2397
 i = usleep(t);
sl@0
  2398
 printf("Expected: 0 usleep returned: %d", i);
sl@0
  2399
  
sl@0
  2400
 return 0;
sl@0
  2401
}
sl@0
  2402
sl@0
  2403
@endcode
sl@0
  2404
 Output
sl@0
  2405
@code
sl@0
  2406
Expected: 0 usleep returned: 0
sl@0
  2407
sl@0
  2408
@endcode
sl@0
  2409
@see nanosleep()
sl@0
  2410
@see sleep()
sl@0
  2411
sl@0
  2412
sl@0
  2413
 
sl@0
  2414
sl@0
  2415
@publishedAll
sl@0
  2416
@externallyDefinedApi
sl@0
  2417
*/
sl@0
  2418
sl@0
  2419
/** @fn truncate(const char *file, off_t length)
sl@0
  2420
@param file
sl@0
  2421
@param length
sl@0
  2422
@return   Upon successful completion, both truncate() and ftruncate() shall return 0; otherwise, -1 shall be returned and errno set to indicate the error.
sl@0
  2423
sl@0
  2424
sl@0
  2425
The  truncate system call causes the file named by  file or referenced by  filedesc to be truncated to  length bytes in size. If the file was larger than this size, the extra data is lost. If the file was smaller than this size, it will be extended as if by writing bytes with the value zero. With  ftruncate, the file must be open for writing.
sl@0
  2426
sl@0
  2427
Examples:
sl@0
  2428
@code
sl@0
  2429
//example for truncate
sl@0
  2430
#include<unistd.h>
sl@0
  2431
#include<stdio.h>
sl@0
  2432
#include <sys/stat.h>
sl@0
  2433
int test_truncate()
sl@0
  2434
{
sl@0
  2435
        int retVal, retVal2, retSize, retSize2;
sl@0
  2436
        struct stat buf;
sl@0
  2437
        ssize_t size;
sl@0
  2438
        char *buffer = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx";
sl@0
  2439
        int fp = open("c:\test.txt", O_RDWR|O_CREAT);
sl@0
  2440
        size = write(fp,buffer,50);
sl@0
  2441
        close(fp);
sl@0
  2442
        retVal2 = stat("c:\test.txt", &buf );
sl@0
  2443
        if ( !retVal2 )
sl@0
  2444
        {
sl@0
  2445
        retSize = buf.st_size;
sl@0
  2446
        printf("Size before: %d", retSize);
sl@0
  2447
        retVal = truncate("c:\test.txt", retSize/2 );
sl@0
  2448
        }
sl@0
  2449
        else
sl@0
  2450
        {
sl@0
  2451
        printf("Failed");
sl@0
  2452
        }
sl@0
  2453
        retVal2 = stat( "c:\test.txt", &buf );
sl@0
  2454
        if ( !retVal2 )
sl@0
  2455
                {
sl@0
  2456
                retSize2 = buf.st_size;
sl@0
  2457
                if( retSize2 == (retSize/2 ) )
sl@0
  2458
                        {
sl@0
  2459
                        printf("\nSize after: %d\n", retSize2);
sl@0
  2460
                        printf("Truncate passed");
sl@0
  2461
                        return 0;
sl@0
  2462
                        }
sl@0
  2463
                else
sl@0
  2464
                        {
sl@0
  2465
                        printf("Failed");
sl@0
  2466
                        return -1;
sl@0
  2467
                        }
sl@0
  2468
                }
sl@0
  2469
        else
sl@0
  2470
                {
sl@0
  2471
                printf("Failed");
sl@0
  2472
                return -1;
sl@0
  2473
                }
sl@0
  2474
}
sl@0
  2475
@endcode
sl@0
  2476
 Output
sl@0
  2477
@code
sl@0
  2478
Size before: 50
sl@0
  2479
Size after: 25
sl@0
  2480
Ttruncate Passed
sl@0
  2481
@endcode
sl@0
  2482
sl@0
  2483
Errors:
sl@0
  2484
sl@0
  2485
The truncate and ftruncate succeed unless:
sl@0
  2486
[EBADF] The filedesc argument is not a valid descriptor for a regular file.
sl@0
  2487
[EINVAL] The filedesc argument references to an object other than a file. 
sl@0
  2488
[EINVAL] The filedesc descriptor is not open for writing.
sl@0
  2489
sl@0
  2490
sl@0
  2491
Bugs:
sl@0
  2492
sl@0
  2493
These calls should be generalized to allow ranges of bytes in a file to be discarded.
sl@0
  2494
Use of truncate to extend a file is not portable. 
sl@0
  2495
@see open()
sl@0
  2496
sl@0
  2497
 
sl@0
  2498
sl@0
  2499
@publishedAll
sl@0
  2500
@externallyDefinedApi
sl@0
  2501
*/
sl@0
  2502
sl@0
  2503
/** @fn truncate64(const char *file, off64_t length)
sl@0
  2504
@param file
sl@0
  2505
@param length
sl@0
  2506
@return   Upon successful completion, both truncate64() and ftruncate64() shall return 0; otherwise, -1 shall be returned and errno set to indicate the error.
sl@0
  2507
sl@0
  2508
For full documentation see: http://www.unix.org/version2/whatsnew/lfs20mar.html#3.0
sl@0
  2509
sl@0
  2510
@see truncate()
sl@0
  2511
sl@0
  2512
@publishedAll
sl@0
  2513
@externallyDefinedApi
sl@0
  2514
*/
sl@0
  2515
sl@0
  2516
/** @fn  brk(const void*)
sl@0
  2517
sl@0
  2518
@return   Function always returns 0.
sl@0
  2519
sl@0
  2520
  The brk function is used to change the amount of memory allocated in a
sl@0
  2521
process's data segment.It does this by moving the location of the "break".
sl@0
  2522
This functionality is not supported by the Symbian OS platform and hence
sl@0
  2523
is only build supported.
sl@0
  2524
sl@0
  2525
sl@0
  2526
sl@0
  2527
@see mmap()
sl@0
  2528
@see free()
sl@0
  2529
@see malloc()
sl@0
  2530
sl@0
  2531
sl@0
  2532
 
sl@0
  2533
sl@0
  2534
@publishedAll
sl@0
  2535
@externallyDefinedApi
sl@0
  2536
*/
sl@0
  2537
sl@0
  2538
/** @fn  getdtablesize(void)
sl@0
  2539
@return  
sl@0
  2540
sl@0
  2541
  Each process has a fixed size descriptor table,
sl@0
  2542
which is guaranteed to have at least 20 slots.
sl@0
  2543
The entries in
sl@0
  2544
the descriptor table are numbered with small integers starting at 0.
sl@0
  2545
The getdtablesize system call returns the size of this table.
sl@0
  2546
sl@0
  2547
Examples:
sl@0
  2548
@code
sl@0
  2549
#include <stdio.h>
sl@0
  2550
int main()
sl@0
  2551
{
sl@0
  2552
        printf("maximum number of files that can be opened by a process is %d",getdtablesize());
sl@0
  2553
}
sl@0
  2554
sl@0
  2555
@endcode
sl@0
  2556
 Output
sl@0
  2557
@code
sl@0
  2558
maximum number of files that can be opened by a process is 1024
sl@0
  2559
sl@0
  2560
@endcode
sl@0
  2561
@see close()
sl@0
  2562
@see dup()
sl@0
  2563
@see open()
sl@0
  2564
sl@0
  2565
sl@0
  2566
 
sl@0
  2567
sl@0
  2568
@publishedAll
sl@0
  2569
@externallyDefinedApi
sl@0
  2570
*/
sl@0
  2571
sl@0
  2572
/** @fn  getpagesize(void)
sl@0
  2573
  The getpagesize function
sl@0
  2574
returns the number of bytes in a page.
sl@0
  2575
Page granularity is the granularity of many of the memory
sl@0
  2576
management calls.
sl@0
  2577
sl@0
  2578
 The page size is a system
sl@0
  2579
page size and may not be the same as the underlying
sl@0
  2580
hardware page size.
sl@0
  2581
sl@0
  2582
Examples:
sl@0
  2583
@code
sl@0
  2584
#include<unistd.h>
sl@0
  2585
#include<stdio.h>
sl@0
  2586
int test_getpagesize()
sl@0
  2587
{
sl@0
  2588
   int retVal = 0;
sl@0
  2589
   retVal = getpagesize();
sl@0
  2590
   if( retVal >= 0)
sl@0
  2591
   {
sl@0
  2592
      printf("getpagesize passed");
sl@0
  2593
      printf("
sl@0
  2594
 retVal  = %d " retVal);
sl@0
  2595
      return retVal;
sl@0
  2596
   }
sl@0
  2597
   else
sl@0
  2598
   {
sl@0
  2599
   printf("Failed");
sl@0
  2600
   return -1;
sl@0
  2601
   }
sl@0
  2602
}       
sl@0
  2603
sl@0
  2604
@endcode
sl@0
  2605
 Output
sl@0
  2606
@code
sl@0
  2607
getpagesize passed
sl@0
  2608
retVal = 4096
sl@0
  2609
sl@0
  2610
@endcode
sl@0
  2611
@see sbrk()
sl@0
  2612
sl@0
  2613
sl@0
  2614
 
sl@0
  2615
sl@0
  2616
@publishedAll
sl@0
  2617
@externallyDefinedApi
sl@0
  2618
*/
sl@0
  2619
sl@0
  2620
/** @fn  initgroups(const char *, gid_t)
sl@0
  2621
sl@0
  2622
@return   These functions always return 0.
sl@0
  2623
sl@0
  2624
 
sl@0
  2625
sl@0
  2626
 The getgroups function is build supported but not available functionally. 
sl@0
  2627
  Symbian OS does not support multiple users and groups.
sl@0
  2628
sl@0
  2629
sl@0
  2630
sl@0
  2631
sl@0
  2632
sl@0
  2633
 
sl@0
  2634
sl@0
  2635
@publishedAll
sl@0
  2636
@externallyDefinedApi
sl@0
  2637
*/
sl@0
  2638
sl@0
  2639
/** @fn issetugid(void)
sl@0
  2640
@return  The issetugid() function returns 1 if the process  was  made setuid  or  setgid  as  the result of the last or a previous call to execve(). Otherwise it returns 0
sl@0
  2641
sl@0
  2642
The issetugid() function enables library functions (in  lib-termlib,   libc,  or  other  libraries)  to  guarantee  safe behavior when  used  in  setuid  or  setgid  programs.  Some library  functions  might be passed insufficient informationand not know whether the current program was started  setuidor  setgid  because  a  higher level calling code might have made changes to the uid, euid, gid, or egid. These low-levellibrary  functions are therefore unable to determine if theyare being run with elevated or normal privileges.
sl@0
  2643
sl@0
  2644
Errors:
sl@0
  2645
sl@0
  2646
The issetugid() function is  always  successful.  No  return value is reserved to indicate an error.
sl@0
  2647
g
sl@0
  2648
@publishedAll
sl@0
  2649
@externallyDefinedApi
sl@0
  2650
*/
sl@0
  2651
sl@0
  2652
/** @fn mkstemp(char *template)
sl@0
  2653
@param template
sl@0
  2654
@return The  mkstemp function returns -1 if no suitable file could be created and an error code is placed in the global variable.  errno.
sl@0
  2655
sl@0
  2656
The  mkstemp function takes the given file name template and overwrites a portion of it to create a file with that name and returns a file descriptor opened for reading and writing. This file name is guaranteed not to exist at the time of function invocation and is suitable for use by the application. The template may be any file name with some number of ‘X s’ appended to it, for example  /tmp/temp.XXXXXX. The trailing ‘X s’ are replaced with a unique alphanumeric combination. The number of unique file names  mkstemp can return depends on the number of ‘X s’ provided; six ‘X s’ will result in  mkstemp selecting one of 56800235584 (62 ** 6) possible temporary file names.
sl@0
  2657
sl@0
  2658
Errors:
sl@0
  2659
sl@0
  2660
The  mkstemp function may set  errno to one of the following values:
sl@0
  2661
[ENOTDIR]	The pathname portion of the template is not an existing directory.
sl@0
  2662
The mkstemp function may also set errno to any value specified by the stat function.
sl@0
  2663
The mkstemp function may also set errno to any value specified by the open function.
sl@0
  2664
sl@0
  2665
Examples:
sl@0
  2666
@code
sl@0
  2667
#include <stdlib.h>
sl@0
  2668
#include <stdio.h> //printf, SEEK_SET
sl@0
  2669
#include <unistd.h>
sl@0
  2670
 
sl@0
  2671
int main( void )
sl@0
  2672
{
sl@0
  2673
 char arr[] = "c:\\someXXXXXXXX";
sl@0
  2674
 char buf[10];
sl@0
  2675
  
sl@0
  2676
 //create a temporary file using mkstemp()
sl@0
  2677
 int fd = mkstemp(arr);
sl@0
  2678
  
sl@0
  2679
 if(fd != -1)
sl@0
  2680
 {
sl@0
  2681
    //write to the file
sl@0
  2682
    write(fd, "hello", 5);
sl@0
  2683
    //seek to the beginning of the file
sl@0
  2684
    lseek(fd, 0, SEEK_SET); //beg of the file
sl@0
  2685
    //read from the file
sl@0
  2686
    read(fd, buf, 5);
sl@0
  2687
    buf[5] = '\0';
sl@0
  2688
    //close the file
sl@0
  2689
    close(fd);
sl@0
  2690
 }
sl@0
  2691
 
sl@0
  2692
 printf("buf read: %s", buf);
sl@0
  2693
 return 0;
sl@0
  2694
}
sl@0
  2695
@endcode
sl@0
  2696
sl@0
  2697
Output
sl@0
  2698
@code
sl@0
  2699
buf read: hello
sl@0
  2700
@endcode
sl@0
  2701
sl@0
  2702
Limitations:
sl@0
  2703
sl@0
  2704
The template parameter of the mkstemp() function should not exceed 256 characters in length. 
sl@0
  2705
sl@0
  2706
@publishedAll
sl@0
  2707
@externallyDefinedApi
sl@0
  2708
*/
sl@0
  2709
sl@0
  2710
/** @fn  mkstemp64(char *template)
sl@0
  2711
@param template
sl@0
  2712
@return   The mkstemp64 function
sl@0
  2713
returns -1 if no suitable file could be created
sl@0
  2714
and an error code is placed in the global variable. errno.
sl@0
  2715
sl@0
  2716
The mkstemp64() function generates a unique temporary file name from template. The last six characters of template must be XXXXXX and these are replaced with a string that makes the filename unique.
sl@0
  2717
sl@0
  2718
The mkstemp64() function is a 64-bit version of mkstemp.
sl@0
  2719
sl@0
  2720
@see mkstemp()
sl@0
  2721
 
sl@0
  2722
@publishedAll
sl@0
  2723
@externallyDefinedApi
sl@0
  2724
*/
sl@0
  2725
sl@0
  2726
/** @fn  select(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *tvptr)
sl@0
  2727
@param maxfd
sl@0
  2728
@param readfds
sl@0
  2729
@param writefds
sl@0
  2730
@param exceptfds
sl@0
  2731
@param tvptr
sl@0
  2732
@return   The select system call
sl@0
  2733
returns the number of ready descriptors that are contained in
sl@0
  2734
the descriptor sets,
sl@0
  2735
or -1 if an error occurred.
sl@0
  2736
If the time limit expires, select returns 0.
sl@0
  2737
If select returns with an error,
sl@0
  2738
the descriptor sets will be unmodified.
sl@0
  2739
sl@0
  2740
  The select system call
sl@0
  2741
examines the I/O descriptor sets whose addresses are passed in readfds, writefds, and exceptfds to see if some of their descriptors
sl@0
  2742
are ready for reading, are ready for writing, or have an exceptional
sl@0
  2743
condition pending, respectively.
sl@0
  2744
The only exceptional condition detectable is out-of-band
sl@0
  2745
data received on a socket.
sl@0
  2746
The first maxfd descriptors are checked in each set;
sl@0
  2747
i.e., the descriptors from 0 through maxfd -1 in the descriptor sets are examined.
sl@0
  2748
On return, select replaces the given descriptor sets
sl@0
  2749
with subsets consisting of those descriptors that are ready
sl@0
  2750
for the requested operation.
sl@0
  2751
The select system call
sl@0
  2752
returns the total number of ready descriptors in all the sets.
sl@0
  2753
sl@0
  2754
 The descriptor sets are stored as bit fields in arrays of integers.
sl@0
  2755
The following macros are provided for manipulating such descriptor sets: 
sl@0
  2756
sl@0
  2757
@code
sl@0
  2758
FD_ZERO (&fdset;); initializes a descriptor set fdset to the null set. 
sl@0
  2759
FD_SET (fd, &fdset;); includes a particular descriptor fd in fdset. 
sl@0
  2760
FD_CLR (fd, &fdset;); removes fd from fdset. 
sl@0
  2761
FD_ISSET (fd, &fdset;); is non-zero if fd is a member of fdset, zero otherwise.
sl@0
  2762
@endcode
sl@0
  2763
sl@0
  2764
The behavior of these macros is undefined if
sl@0
  2765
a descriptor value is less than zero or greater than or equal to FD_SETSIZE, which is normally at least equal
sl@0
  2766
to the maximum number of descriptors supported by the system.
sl@0
  2767
sl@0
  2768
 If tvptr is not a null pointer, it specifies the maximum interval to wait for the
sl@0
  2769
selection to complete.
sl@0
  2770
System activity can lengthen the interval by
sl@0
  2771
an indeterminate amount.
sl@0
  2772
sl@0
  2773
 To effect a poll, the tvptr argument should not be a null pointer,
sl@0
  2774
but it should point to a zero-valued timeval structure.
sl@0
  2775
sl@0
  2776
 Any of readfds, writefds, and exceptfds may be given as null pointers if no descriptors are of interest.
sl@0
  2777
sl@0
  2778
Errors:
sl@0
  2779
sl@0
  2780
An error return from  select indicates:
sl@0
  2781
[EBADF] 	One of the descriptor sets specified an invalid descriptor.
sl@0
  2782
[EFAULT] 	One of the arguments readfds, writefds, exceptfds, or tvptr points to an invalid address.
sl@0
  2783
[EINVAL] 	The specified time limit is invalid. One of its components is negative or too large.
sl@0
  2784
[EINVAL] 	The maxfd argument was invalid.
sl@0
  2785
sl@0
  2786
Limitations:
sl@0
  2787
sl@0
  2788
select is not interrupted by signals, as signals are not supported by 
sl@0
  2789
Symbian OS. If tvptr is set to null, select does not block forever, but waits for a maximum of 10 seconds 
sl@0
  2790
and returns. select cannot be called a second time on the same socket descriptor 
sl@0
  2791
before the first select operation on the same socket descriptor completes. (i.e) Only 
sl@0
  2792
one select operation can be outstanding on a Socket. This is because of 
sl@0
  2793
the limitation of the underlying Ioctl operation. Only one Ioctl operation may be outstanding for each socket.
sl@0
  2794
Examples:
sl@0
  2795
@code
sl@0
  2796
#include <sys/select.h>
sl@0
  2797
#include <unistd.h>
sl@0
  2798
/*
sl@0
  2799
* A simple example of testing a single FD for readability
sl@0
  2800
* This example returns 1 when the fd is ready for reading.
sl@0
  2801
*/
sl@0
  2802
#include <sys/select.h>
sl@0
  2803
#include <unistd.h>
sl@0
  2804
/*
sl@0
  2805
* A simple example of testing a single FD for readability
sl@0
  2806
* This example returns 1 when the fd is ready for reading.
sl@0
  2807
*/
sl@0
  2808
int isready(int fd)
sl@0
  2809
{
sl@0
  2810
    int rc;
sl@0
  2811
    fd_set fds;
sl@0
  2812
    struct timeval tv;
sl@0
  2813
   
sl@0
  2814
    /*
sl@0
  2815
     * FD_ZERO() clears out the fd_set called fds, so that
sl@0
  2816
     * it doesn’t contain any file descriptors.
sl@0
  2817
     */
sl@0
  2818
    FD_ZERO(&fds);
sl@0
  2819
    /*
sl@0
  2820
     * FD_SET() adds the file descriptor "fd" to the fd_set,
sl@0
  2821
     * so that select() will return if fd is readable
sl@0
  2822
     */
sl@0
  2823
    FD_SET(fd,&fds);
sl@0
  2824
    tv.tv_sec = tv.tv_usec = 0;
sl@0
  2825
    /*
sl@0
  2826
     * The first argument to select is the highest file
sl@0
  2827
     * descriptor value plus 1.
sl@0
  2828
     */
sl@0
  2829
                        
sl@0
  2830
     /* The second argument to select() is the address of
sl@0
  2831
      * the fd_set that contains fd’s we’re waiting
sl@0
  2832
      * to be readable.
sl@0
  2833
      */
sl@0
  2834
                        
sl@0
  2835
     /* The third parameter is an fd_set that you want to
sl@0
  2836
      * know if you can write on -- this example doesn’t
sl@0
  2837
      * use it, so it passes 0, or NULL.
sl@0
  2838
      */
sl@0
  2839
     /* The fourth parameter is sockets you’re waiting for
sl@0
  2840
      * out-of-band data for.
sl@0
  2841
      */
sl@0
  2842
                
sl@0
  2843
     /* The last parameter to select() is a time-out of how
sl@0
  2844
      * long select() should block.
sl@0
  2845
      */
sl@0
  2846
     rc = select(fd+1, &fds, NULL, NULL, &tv);
sl@0
  2847
     /* select() returns the number of fd’s that are ready       
sl@0
  2848
      * Once select() returns, the original fd_set has been
sl@0
  2849
      * modified so it now reflects the state of why select()
sl@0
  2850
      * woke up. i.e. If file descriptor 4 was originally in
sl@0
  2851
      * the fd_set, and then it became readable, the fd_set
sl@0
  2852
      * contains file descriptor 4 in it.
sl@0
  2853
      */
sl@0
  2854
     if (rc < 0)
sl@0
  2855
       return -1;
sl@0
  2856
     return FD_ISSET(fd,&fds) ? 1 : 0;
sl@0
  2857
}
sl@0
  2858
@endcode
sl@0
  2859
@see accept()
sl@0
  2860
@see connect()
sl@0
  2861
@see getdtablesize()
sl@0
  2862
@see gettimeofday()
sl@0
  2863
@see read()
sl@0
  2864
@see recv()
sl@0
  2865
@see send()
sl@0
  2866
@see write()
sl@0
  2867
sl@0
  2868
sl@0
  2869
Notes:
sl@0
  2870
sl@0
  2871
 The default size of FD_SETSIZE is currently set to 1024.
sl@0
  2872
In order to accommodate programs which might potentially
sl@0
  2873
use a larger number of open files with select, it is possible
sl@0
  2874
to increase this size by having the program define FD_SETSIZE before the inclusion of any header which includes 
sl@0
  2875
sl@0
  2876
\#include \< sys/types.h \> 
sl@0
  2877
sl@0
  2878
If maxfd is greater than the number of open files, select is not guaranteed to examine the unused file descriptors. For 
sl@0
  2879
  historical reasons, select will always examine the first 256 descriptors. 
sl@0
  2880
sl@0
  2881
The select system call appeared in BSD 4.2.
sl@0
  2882
sl@0
  2883
Bugs:
sl@0
  2884
sl@0
  2885
<code> -susv2 </code> allows systems to modify the original tvptr in place.
sl@0
  2886
Thus, it is unwise to assume that the tvptr value will be unmodified
sl@0
  2887
by the select system call.
sl@0
  2888
 
sl@0
  2889
sl@0
  2890
 
sl@0
  2891
sl@0
  2892
@publishedAll
sl@0
  2893
@externallyDefinedApi
sl@0
  2894
*/
sl@0
  2895
sl@0
  2896
/** @fn  setgroups(int, const gid_t *)
sl@0
  2897
sl@0
  2898
Refer to  getgrent() for the documentation
sl@0
  2899
sl@0
  2900
sl@0
  2901
 
sl@0
  2902
sl@0
  2903
@publishedAll
sl@0
  2904
@externallyDefinedApi
sl@0
  2905
*/
sl@0
  2906
sl@0
  2907
sl@0
  2908
/** @fn  alarm(unsigned int seconds)
sl@0
  2909
@param seconds -
sl@0
  2910
@return -
sl@0
  2911
sl@0
  2912
For full documentation see: http://www.opengroup.org/onlinepubs/009695399/functions/alarm.html
sl@0
  2913
sl@0
  2914
The Symbian implementation of this API fully supports POSIX functionality.
sl@0
  2915
sl@0
  2916
@publishedAll
sl@0
  2917
@externallyDefinedApi
sl@0
  2918
*/
sl@0
  2919
sl@0
  2920
/** @def environ	
sl@0
  2921
sl@0
  2922
Environment variable.
sl@0
  2923
  
sl@0
  2924
@publishedAll
sl@0
  2925
@released
sl@0
  2926
*/
sl@0
  2927
sl@0
  2928
/** @def STDIN_FILENO
sl@0
  2929
sl@0
  2930
standard input file descriptor 
sl@0
  2931
sl@0
  2932
@publishedAll
sl@0
  2933
@externallyDefinedApi
sl@0
  2934
*/
sl@0
  2935
sl@0
  2936
/** @def STDOUT_FILENO
sl@0
  2937
sl@0
  2938
standard output file descriptor
sl@0
  2939
sl@0
  2940
@publishedAll
sl@0
  2941
@externallyDefinedApi
sl@0
  2942
*/
sl@0
  2943
sl@0
  2944
/** @def STDERR_FILENO
sl@0
  2945
sl@0
  2946
standard error file descriptor
sl@0
  2947
sl@0
  2948
@publishedAll
sl@0
  2949
@externallyDefinedApi
sl@0
  2950
*/
sl@0
  2951
sl@0
  2952
/** @def F_ULOCK
sl@0
  2953
sl@0
  2954
unlock locked section
sl@0
  2955
sl@0
  2956
@publishedAll
sl@0
  2957
@externallyDefinedApi
sl@0
  2958
*/
sl@0
  2959
sl@0
  2960
/** @def F_LOCK
sl@0
  2961
sl@0
  2962
lock a section for exclusive use
sl@0
  2963
sl@0
  2964
@publishedAll
sl@0
  2965
@externallyDefinedApi
sl@0
  2966
*/
sl@0
  2967
sl@0
  2968
/** @def F_TLOCK
sl@0
  2969
sl@0
  2970
test and lock a section for exclusive use
sl@0
  2971
sl@0
  2972
@publishedAll
sl@0
  2973
@externallyDefinedApi
sl@0
  2974
*/
sl@0
  2975
sl@0
  2976
/** @def F_TEST
sl@0
  2977
sl@0
  2978
test a section for locks by other procs
sl@0
  2979
sl@0
  2980
@publishedAll
sl@0
  2981
@externallyDefinedApi
sl@0
  2982
*/
sl@0
  2983
sl@0
  2984
/** @def _SC_ARG_MAX
sl@0
  2985
sl@0
  2986
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  2987
sl@0
  2988
@publishedAll
sl@0
  2989
@externallyDefinedApi
sl@0
  2990
*/
sl@0
  2991
sl@0
  2992
/** @def _SC_CHILD_MAX		
sl@0
  2993
sl@0
  2994
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  2995
 
sl@0
  2996
@publishedAll
sl@0
  2997
@externallyDefinedApi
sl@0
  2998
*/
sl@0
  2999
sl@0
  3000
/** @def _SC_CLK_TCK	
sl@0
  3001
sl@0
  3002
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3003
	 
sl@0
  3004
@publishedAll
sl@0
  3005
@externallyDefinedApi
sl@0
  3006
*/
sl@0
  3007
sl@0
  3008
/** @def _SC_NGROUPS_MAX
sl@0
  3009
sl@0
  3010
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3011
		 
sl@0
  3012
@publishedAll
sl@0
  3013
@externallyDefinedApi
sl@0
  3014
*/
sl@0
  3015
sl@0
  3016
/** @def _SC_OPEN_MAX	
sl@0
  3017
sl@0
  3018
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3019
	 
sl@0
  3020
@publishedAll
sl@0
  3021
@externallyDefinedApi
sl@0
  3022
*/
sl@0
  3023
sl@0
  3024
/** @def _SC_JOB_CONTROL
sl@0
  3025
sl@0
  3026
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3027
		 
sl@0
  3028
@publishedAll
sl@0
  3029
@externallyDefinedApi
sl@0
  3030
*/
sl@0
  3031
sl@0
  3032
/** @def _SC_SAVED_IDS	
sl@0
  3033
sl@0
  3034
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3035
	 
sl@0
  3036
@publishedAll
sl@0
  3037
@externallyDefinedApi
sl@0
  3038
*/
sl@0
  3039
sl@0
  3040
/** @def _SC_VERSION	
sl@0
  3041
sl@0
  3042
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3043
	 
sl@0
  3044
@publishedAll
sl@0
  3045
@externallyDefinedApi
sl@0
  3046
*/
sl@0
  3047
sl@0
  3048
/** @def _SC_BC_BASE_MAX	
sl@0
  3049
sl@0
  3050
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3051
	 
sl@0
  3052
@publishedAll
sl@0
  3053
@externallyDefinedApi
sl@0
  3054
*/
sl@0
  3055
sl@0
  3056
/** @def _SC_BC_DIM_MAX	
sl@0
  3057
sl@0
  3058
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3059
	
sl@0
  3060
@publishedAll
sl@0
  3061
@externallyDefinedApi
sl@0
  3062
*/
sl@0
  3063
sl@0
  3064
/** @def _SC_BC_SCALE_MAX
sl@0
  3065
sl@0
  3066
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3067
	
sl@0
  3068
@publishedAll
sl@0
  3069
@externallyDefinedApi
sl@0
  3070
*/
sl@0
  3071
sl@0
  3072
/** @def _SC_BC_STRING_MAX
sl@0
  3073
sl@0
  3074
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3075
	
sl@0
  3076
@publishedAll
sl@0
  3077
@externallyDefinedApi
sl@0
  3078
*/
sl@0
  3079
sl@0
  3080
/** @def _SC_COLL_WEIGHTS_MAX	
sl@0
  3081
sl@0
  3082
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3083
sl@0
  3084
@publishedAll
sl@0
  3085
@externallyDefinedApi
sl@0
  3086
*/
sl@0
  3087
sl@0
  3088
/** @def _SC_EXPR_NEST_MAX	
sl@0
  3089
sl@0
  3090
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3091
sl@0
  3092
@publishedAll
sl@0
  3093
@externallyDefinedApi
sl@0
  3094
*/
sl@0
  3095
sl@0
  3096
/** @def _SC_LINE_MAX		
sl@0
  3097
sl@0
  3098
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3099
sl@0
  3100
@publishedAll
sl@0
  3101
@externallyDefinedApi
sl@0
  3102
*/
sl@0
  3103
sl@0
  3104
/** @def _SC_RE_DUP_MAX		
sl@0
  3105
sl@0
  3106
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3107
sl@0
  3108
@publishedAll
sl@0
  3109
@externallyDefinedApi
sl@0
  3110
*/
sl@0
  3111
sl@0
  3112
/** @def _SC_2_VERSION	
sl@0
  3113
sl@0
  3114
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3115
	
sl@0
  3116
@publishedAll
sl@0
  3117
@externallyDefinedApi
sl@0
  3118
*/
sl@0
  3119
sl@0
  3120
/** @def _SC_2_C_BIND		
sl@0
  3121
sl@0
  3122
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3123
sl@0
  3124
@publishedAll
sl@0
  3125
@externallyDefinedApi
sl@0
  3126
*/
sl@0
  3127
sl@0
  3128
/** @def _SC_2_C_DEV		
sl@0
  3129
sl@0
  3130
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3131
sl@0
  3132
@publishedAll
sl@0
  3133
@externallyDefinedApi
sl@0
  3134
*/
sl@0
  3135
sl@0
  3136
/** @def _SC_2_CHAR_TERM	
sl@0
  3137
sl@0
  3138
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3139
	
sl@0
  3140
@publishedAll
sl@0
  3141
@externallyDefinedApi
sl@0
  3142
*/
sl@0
  3143
sl@0
  3144
/** @def _SC_2_FORT_DEV		
sl@0
  3145
sl@0
  3146
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3147
sl@0
  3148
@publishedAll
sl@0
  3149
@externallyDefinedApi
sl@0
  3150
*/
sl@0
  3151
sl@0
  3152
/** @def _SC_2_FORT_RUN		
sl@0
  3153
sl@0
  3154
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3155
sl@0
  3156
@publishedAll
sl@0
  3157
@externallyDefinedApi
sl@0
  3158
*/
sl@0
  3159
sl@0
  3160
/** @def _SC_2_LOCALEDEF	
sl@0
  3161
sl@0
  3162
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3163
	
sl@0
  3164
@publishedAll
sl@0
  3165
@externallyDefinedApi
sl@0
  3166
*/
sl@0
  3167
sl@0
  3168
/** @def _SC_2_SW_DEV		
sl@0
  3169
sl@0
  3170
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3171
sl@0
  3172
@publishedAll
sl@0
  3173
@externallyDefinedApi
sl@0
  3174
*/
sl@0
  3175
sl@0
  3176
/** @def _SC_2_UPE		
sl@0
  3177
sl@0
  3178
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3179
sl@0
  3180
@publishedAll
sl@0
  3181
@externallyDefinedApi
sl@0
  3182
*/
sl@0
  3183
sl@0
  3184
/** @def _SC_STREAM_MAX		
sl@0
  3185
sl@0
  3186
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3187
sl@0
  3188
@publishedAll
sl@0
  3189
@externallyDefinedApi
sl@0
  3190
*/
sl@0
  3191
sl@0
  3192
/** @def _SC_TZNAME_MAX		
sl@0
  3193
sl@0
  3194
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3195
sl@0
  3196
@publishedAll
sl@0
  3197
@externallyDefinedApi
sl@0
  3198
*/
sl@0
  3199
sl@0
  3200
/** @def _SC_ASYNCHRONOUS_IO	
sl@0
  3201
sl@0
  3202
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3203
sl@0
  3204
@publishedAll
sl@0
  3205
@externallyDefinedApi
sl@0
  3206
*/
sl@0
  3207
sl@0
  3208
/** @def _SC_MAPPED_FILES	
sl@0
  3209
sl@0
  3210
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3211
sl@0
  3212
@publishedAll
sl@0
  3213
@externallyDefinedApi
sl@0
  3214
*/
sl@0
  3215
sl@0
  3216
/** @def _SC_MEMLOCK		
sl@0
  3217
sl@0
  3218
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3219
sl@0
  3220
@publishedAll
sl@0
  3221
@externallyDefinedApi
sl@0
  3222
*/
sl@0
  3223
sl@0
  3224
/** @def _SC_MEMLOCK_RANGE	
sl@0
  3225
sl@0
  3226
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3227
sl@0
  3228
@publishedAll
sl@0
  3229
@externallyDefinedApi
sl@0
  3230
*/
sl@0
  3231
sl@0
  3232
/** @def _SC_MEMORY_PROTECTION	
sl@0
  3233
sl@0
  3234
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3235
sl@0
  3236
@publishedAll
sl@0
  3237
@externallyDefinedApi
sl@0
  3238
*/
sl@0
  3239
sl@0
  3240
/** @def _SC_MESSAGE_PASSING	
sl@0
  3241
sl@0
  3242
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3243
sl@0
  3244
@publishedAll
sl@0
  3245
@externallyDefinedApi
sl@0
  3246
*/
sl@0
  3247
sl@0
  3248
/** @def _SC_PRIORITIZED_IO	
sl@0
  3249
sl@0
  3250
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3251
sl@0
  3252
@publishedAll
sl@0
  3253
@externallyDefinedApi
sl@0
  3254
*/
sl@0
  3255
sl@0
  3256
/** @def _SC_PRIORITY_SCHEDULING
sl@0
  3257
sl@0
  3258
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3259
	
sl@0
  3260
@publishedAll
sl@0
  3261
@externallyDefinedApi
sl@0
  3262
*/
sl@0
  3263
sl@0
  3264
/** @def _SC_REALTIME_SIGNALS	
sl@0
  3265
sl@0
  3266
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3267
sl@0
  3268
@publishedAll
sl@0
  3269
@externallyDefinedApi
sl@0
  3270
*/
sl@0
  3271
sl@0
  3272
/** @def _SC_SEMAPHORES	
sl@0
  3273
sl@0
  3274
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3275
	
sl@0
  3276
@publishedAll
sl@0
  3277
@externallyDefinedApi
sl@0
  3278
*/
sl@0
  3279
sl@0
  3280
/** @def _SC_FSYNC	
sl@0
  3281
sl@0
  3282
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3283
	
sl@0
  3284
@publishedAll
sl@0
  3285
@externallyDefinedApi
sl@0
  3286
*/
sl@0
  3287
sl@0
  3288
/** @def _SC_SHARED_MEMORY_OBJECTS 
sl@0
  3289
sl@0
  3290
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3291
sl@0
  3292
@publishedAll
sl@0
  3293
@externallyDefinedApi
sl@0
  3294
*/
sl@0
  3295
sl@0
  3296
/** @def _SC_SYNCHRONIZED_IO	
sl@0
  3297
sl@0
  3298
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3299
sl@0
  3300
@publishedAll
sl@0
  3301
@externallyDefinedApi
sl@0
  3302
*/
sl@0
  3303
sl@0
  3304
/** @def _SC_TIMERS		
sl@0
  3305
sl@0
  3306
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3307
sl@0
  3308
@publishedAll
sl@0
  3309
@externallyDefinedApi
sl@0
  3310
*/
sl@0
  3311
sl@0
  3312
/** @def _SC_AIO_LISTIO_MAX	
sl@0
  3313
sl@0
  3314
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3315
sl@0
  3316
@publishedAll
sl@0
  3317
@externallyDefinedApi
sl@0
  3318
*/
sl@0
  3319
sl@0
  3320
/** @def _SC_AIO_MAX		
sl@0
  3321
sl@0
  3322
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3323
sl@0
  3324
@publishedAll
sl@0
  3325
@externallyDefinedApi
sl@0
  3326
*/
sl@0
  3327
sl@0
  3328
/** @def _SC_AIO_PRIO_DELTA_MAX	
sl@0
  3329
sl@0
  3330
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3331
sl@0
  3332
@publishedAll
sl@0
  3333
@externallyDefinedApi
sl@0
  3334
*/
sl@0
  3335
sl@0
  3336
/** @def _SC_DELAYTIMER_MAX
sl@0
  3337
sl@0
  3338
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3339
	
sl@0
  3340
@publishedAll
sl@0
  3341
@externallyDefinedApi
sl@0
  3342
*/
sl@0
  3343
sl@0
  3344
/** @def _SC_MQ_OPEN_MAX	
sl@0
  3345
sl@0
  3346
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3347
	
sl@0
  3348
@publishedAll
sl@0
  3349
@externallyDefinedApi
sl@0
  3350
*/
sl@0
  3351
sl@0
  3352
/** @def _SC_PAGESIZE		
sl@0
  3353
sl@0
  3354
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3355
sl@0
  3356
@publishedAll
sl@0
  3357
@externallyDefinedApi
sl@0
  3358
*/
sl@0
  3359
sl@0
  3360
/** @def _SC_RTSIG_MAX		
sl@0
  3361
sl@0
  3362
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3363
sl@0
  3364
@publishedAll
sl@0
  3365
@externallyDefinedApi
sl@0
  3366
*/
sl@0
  3367
sl@0
  3368
/** @def _SC_SEM_NSEMS_MAX	
sl@0
  3369
sl@0
  3370
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3371
sl@0
  3372
@publishedAll
sl@0
  3373
@externallyDefinedApi
sl@0
  3374
*/
sl@0
  3375
sl@0
  3376
/** @def _SC_SEM_VALUE_MAX	
sl@0
  3377
sl@0
  3378
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3379
sl@0
  3380
@publishedAll
sl@0
  3381
@externallyDefinedApi
sl@0
  3382
*/
sl@0
  3383
sl@0
  3384
/** @def _SC_SIGQUEUE_MAX	
sl@0
  3385
sl@0
  3386
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3387
sl@0
  3388
@publishedAll
sl@0
  3389
@externallyDefinedApi
sl@0
  3390
*/
sl@0
  3391
sl@0
  3392
/** @def _SC_TIMER_MAX		
sl@0
  3393
sl@0
  3394
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3395
sl@0
  3396
@publishedAll
sl@0
  3397
@externallyDefinedApi
sl@0
  3398
*/
sl@0
  3399
sl@0
  3400
/** @def _SC_2_PBS		
sl@0
  3401
sl@0
  3402
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3403
sl@0
  3404
@publishedAll
sl@0
  3405
@externallyDefinedApi
sl@0
  3406
*/
sl@0
  3407
sl@0
  3408
/** @def _SC_2_PBS_ACCOUNTING	
sl@0
  3409
sl@0
  3410
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3411
sl@0
  3412
@publishedAll
sl@0
  3413
@externallyDefinedApi
sl@0
  3414
*/
sl@0
  3415
sl@0
  3416
/** @def _SC_2_PBS_CHECKPOINT	
sl@0
  3417
sl@0
  3418
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3419
sl@0
  3420
@publishedAll
sl@0
  3421
@externallyDefinedApi
sl@0
  3422
*/
sl@0
  3423
sl@0
  3424
/** @def _SC_2_PBS_LOCATE	
sl@0
  3425
sl@0
  3426
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3427
sl@0
  3428
@publishedAll
sl@0
  3429
@externallyDefinedApi
sl@0
  3430
*/ 
sl@0
  3431
sl@0
  3432
/** @def _SC_2_PBS_MESSAGE	
sl@0
  3433
sl@0
  3434
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3435
sl@0
  3436
@publishedAll
sl@0
  3437
@externallyDefinedApi
sl@0
  3438
*/
sl@0
  3439
sl@0
  3440
/** @def _SC_2_PBS_TRACK	
sl@0
  3441
sl@0
  3442
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3443
	
sl@0
  3444
@publishedAll
sl@0
  3445
@externallyDefinedApi
sl@0
  3446
*/
sl@0
  3447
sl@0
  3448
/** @def _SC_ADVISORY_INFO	
sl@0
  3449
sl@0
  3450
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3451
sl@0
  3452
@publishedAll
sl@0
  3453
@externallyDefinedApi
sl@0
  3454
*/
sl@0
  3455
sl@0
  3456
/** @def _SC_BARRIERS		
sl@0
  3457
sl@0
  3458
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3459
sl@0
  3460
@publishedAll
sl@0
  3461
@externallyDefinedApi
sl@0
  3462
*/
sl@0
  3463
sl@0
  3464
/** @def _SC_CLOCK_SELECTION	
sl@0
  3465
sl@0
  3466
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3467
sl@0
  3468
@publishedAll
sl@0
  3469
@externallyDefinedApi
sl@0
  3470
*/
sl@0
  3471
sl@0
  3472
/** @def _SC_CPUTIME		
sl@0
  3473
sl@0
  3474
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3475
sl@0
  3476
@publishedAll
sl@0
  3477
@externallyDefinedApi
sl@0
  3478
*/
sl@0
  3479
sl@0
  3480
/** @def _SC_FILE_LOCKING	
sl@0
  3481
sl@0
  3482
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3483
sl@0
  3484
@publishedAll
sl@0
  3485
@externallyDefinedApi
sl@0
  3486
*/
sl@0
  3487
sl@0
  3488
/** @def _SC_GETGR_R_SIZE_MAX	
sl@0
  3489
sl@0
  3490
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3491
sl@0
  3492
@publishedAll
sl@0
  3493
@externallyDefinedApi
sl@0
  3494
*/
sl@0
  3495
sl@0
  3496
/** @def _SC_GETPW_R_SIZE_MAX	
sl@0
  3497
sl@0
  3498
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3499
sl@0
  3500
@publishedAll
sl@0
  3501
@externallyDefinedApi
sl@0
  3502
*/
sl@0
  3503
sl@0
  3504
/** @def _SC_HOST_NAME_MAX	
sl@0
  3505
sl@0
  3506
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3507
sl@0
  3508
@publishedAll
sl@0
  3509
@externallyDefinedApi
sl@0
  3510
*/
sl@0
  3511
sl@0
  3512
/** @def _SC_LOGIN_NAME_MAX	
sl@0
  3513
sl@0
  3514
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3515
sl@0
  3516
@publishedAll
sl@0
  3517
@externallyDefinedApi
sl@0
  3518
*/
sl@0
  3519
sl@0
  3520
/** @def _SC_MONOTONIC_CLOCK	
sl@0
  3521
sl@0
  3522
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3523
sl@0
  3524
@publishedAll
sl@0
  3525
@externallyDefinedApi
sl@0
  3526
*/
sl@0
  3527
sl@0
  3528
/** @def _SC_MQ_PRIO_MAX	
sl@0
  3529
sl@0
  3530
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3531
	
sl@0
  3532
@publishedAll
sl@0
  3533
@externallyDefinedApi
sl@0
  3534
*/
sl@0
  3535
sl@0
  3536
/** @def _SC_READER_WRITER_LOCKS	
sl@0
  3537
sl@0
  3538
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3539
sl@0
  3540
@publishedAll
sl@0
  3541
@externallyDefinedApi
sl@0
  3542
*/
sl@0
  3543
sl@0
  3544
/** @def _SC_REGEXP		
sl@0
  3545
sl@0
  3546
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3547
sl@0
  3548
@publishedAll
sl@0
  3549
@externallyDefinedApi
sl@0
  3550
*/
sl@0
  3551
sl@0
  3552
/** @def _SC_SHELL		
sl@0
  3553
sl@0
  3554
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3555
sl@0
  3556
@publishedAll
sl@0
  3557
@externallyDefinedApi
sl@0
  3558
*/
sl@0
  3559
sl@0
  3560
/** @def _SC_SPAWN		
sl@0
  3561
sl@0
  3562
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3563
sl@0
  3564
@publishedAll
sl@0
  3565
@externallyDefinedApi
sl@0
  3566
*/
sl@0
  3567
sl@0
  3568
/** @def _SC_SPIN_LOCKS		
sl@0
  3569
sl@0
  3570
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3571
sl@0
  3572
@publishedAll
sl@0
  3573
@externallyDefinedApi
sl@0
  3574
*/
sl@0
  3575
sl@0
  3576
/** @def _SC_SPORADIC_SERVER	
sl@0
  3577
sl@0
  3578
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3579
sl@0
  3580
@publishedAll
sl@0
  3581
@externallyDefinedApi
sl@0
  3582
*/
sl@0
  3583
sl@0
  3584
/** @def _SC_THREAD_ATTR_STACKADDR 
sl@0
  3585
sl@0
  3586
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3587
sl@0
  3588
@publishedAll
sl@0
  3589
@externallyDefinedApi
sl@0
  3590
*/
sl@0
  3591
sl@0
  3592
/** @def _SC_THREAD_ATTR_STACKSIZE 
sl@0
  3593
sl@0
  3594
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3595
sl@0
  3596
@publishedAll
sl@0
  3597
@externallyDefinedApi
sl@0
  3598
*/
sl@0
  3599
sl@0
  3600
/** @def _SC_THREAD_CPUTIME	
sl@0
  3601
sl@0
  3602
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3603
sl@0
  3604
@publishedAll
sl@0
  3605
@externallyDefinedApi
sl@0
  3606
*/
sl@0
  3607
sl@0
  3608
/** @def _SC_THREAD_DESTRUCTOR_ITERATIONS 
sl@0
  3609
sl@0
  3610
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3611
sl@0
  3612
@publishedAll
sl@0
  3613
@externallyDefinedApi
sl@0
  3614
*/
sl@0
  3615
sl@0
  3616
/** @def _SC_THREAD_KEYS_MAX	
sl@0
  3617
sl@0
  3618
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3619
sl@0
  3620
@publishedAll
sl@0
  3621
@externallyDefinedApi
sl@0
  3622
*/
sl@0
  3623
sl@0
  3624
/** @def _SC_THREAD_PRIO_INHERIT	
sl@0
  3625
sl@0
  3626
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3627
sl@0
  3628
@publishedAll
sl@0
  3629
@externallyDefinedApi
sl@0
  3630
*/
sl@0
  3631
sl@0
  3632
/** @def _SC_THREAD_PRIO_PROTECT	
sl@0
  3633
sl@0
  3634
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3635
sl@0
  3636
@publishedAll
sl@0
  3637
@externallyDefinedApi
sl@0
  3638
*/
sl@0
  3639
sl@0
  3640
/** @def _SC_THREAD_PRIORITY_SCHEDULING 
sl@0
  3641
sl@0
  3642
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3643
sl@0
  3644
@publishedAll
sl@0
  3645
@externallyDefinedApi
sl@0
  3646
*/
sl@0
  3647
sl@0
  3648
/** @def _SC_THREAD_PROCESS_SHARED 
sl@0
  3649
sl@0
  3650
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3651
sl@0
  3652
@publishedAll
sl@0
  3653
@externallyDefinedApi
sl@0
  3654
*/
sl@0
  3655
sl@0
  3656
/** @def _SC_THREAD_SAFE_FUNCTIONS 
sl@0
  3657
sl@0
  3658
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3659
sl@0
  3660
@publishedAll
sl@0
  3661
@externallyDefinedApi
sl@0
  3662
*/
sl@0
  3663
sl@0
  3664
/** @def _SC_THREAD_SPORADIC_SERVER 
sl@0
  3665
sl@0
  3666
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3667
sl@0
  3668
@publishedAll
sl@0
  3669
@externallyDefinedApi
sl@0
  3670
*/
sl@0
  3671
sl@0
  3672
/** @def _SC_THREAD_STACK_MIN	
sl@0
  3673
sl@0
  3674
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3675
sl@0
  3676
@publishedAll
sl@0
  3677
@externallyDefinedApi
sl@0
  3678
*/
sl@0
  3679
sl@0
  3680
/** @def _SC_THREAD_THREADS_MAX	
sl@0
  3681
sl@0
  3682
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3683
sl@0
  3684
@publishedAll
sl@0
  3685
@externallyDefinedApi
sl@0
  3686
*/
sl@0
  3687
sl@0
  3688
/** @def _SC_TIMEOUTS		
sl@0
  3689
sl@0
  3690
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3691
sl@0
  3692
@publishedAll
sl@0
  3693
@externallyDefinedApi
sl@0
  3694
*/
sl@0
  3695
sl@0
  3696
/** @def _SC_THREADS	
sl@0
  3697
sl@0
  3698
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3699
	
sl@0
  3700
@publishedAll
sl@0
  3701
@externallyDefinedApi
sl@0
  3702
*/
sl@0
  3703
sl@0
  3704
/** @def _SC_TRACE	
sl@0
  3705
sl@0
  3706
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3707
	
sl@0
  3708
@publishedAll
sl@0
  3709
@externallyDefinedApi
sl@0
  3710
*/
sl@0
  3711
sl@0
  3712
/** @def _SC_TRACE_EVENT_FILTER	
sl@0
  3713
sl@0
  3714
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3715
sl@0
  3716
@publishedAll
sl@0
  3717
@externallyDefinedApi
sl@0
  3718
*/
sl@0
  3719
sl@0
  3720
/** @def _SC_TRACE_INHERIT	
sl@0
  3721
sl@0
  3722
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3723
sl@0
  3724
@publishedAll
sl@0
  3725
@externallyDefinedApi
sl@0
  3726
*/
sl@0
  3727
sl@0
  3728
/** @def _SC_TRACE_LOG		
sl@0
  3729
sl@0
  3730
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3731
sl@0
  3732
@publishedAll
sl@0
  3733
@externallyDefinedApi
sl@0
  3734
*/
sl@0
  3735
sl@0
  3736
/** @def _SC_TTY_NAME_MAX	
sl@0
  3737
sl@0
  3738
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3739
sl@0
  3740
@publishedAll
sl@0
  3741
@externallyDefinedApi
sl@0
  3742
*/
sl@0
  3743
sl@0
  3744
/** @def _SC_TYPED_MEMORY_OBJECTS 
sl@0
  3745
sl@0
  3746
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3747
sl@0
  3748
@publishedAll
sl@0
  3749
@externallyDefinedApi
sl@0
  3750
*/
sl@0
  3751
sl@0
  3752
/** @def _SC_V6_ILP32_OFF32	
sl@0
  3753
sl@0
  3754
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3755
sl@0
  3756
@publishedAll
sl@0
  3757
@externallyDefinedApi
sl@0
  3758
*/
sl@0
  3759
sl@0
  3760
/** @def _SC_V6_ILP32_OFFBIG	
sl@0
  3761
sl@0
  3762
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3763
sl@0
  3764
@publishedAll
sl@0
  3765
@externallyDefinedApi
sl@0
  3766
*/
sl@0
  3767
sl@0
  3768
/** @def _SC_V6_LP64_OFF64	
sl@0
  3769
sl@0
  3770
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3771
sl@0
  3772
@publishedAll
sl@0
  3773
@externallyDefinedApi
sl@0
  3774
*/
sl@0
  3775
sl@0
  3776
/** @def _SC_V6_LPBIG_OFFBIG	
sl@0
  3777
sl@0
  3778
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3779
sl@0
  3780
@publishedAll
sl@0
  3781
@externallyDefinedApi
sl@0
  3782
*/
sl@0
  3783
sl@0
  3784
/** @def _SC_IPV6		
sl@0
  3785
sl@0
  3786
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3787
sl@0
  3788
@publishedAll
sl@0
  3789
@externallyDefinedApi
sl@0
  3790
*/
sl@0
  3791
sl@0
  3792
/** @def _SC_RAW_SOCKETS	
sl@0
  3793
sl@0
  3794
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3795
	
sl@0
  3796
@publishedAll
sl@0
  3797
@externallyDefinedApi
sl@0
  3798
*/
sl@0
  3799
sl@0
  3800
/** @def _SC_SYMLOOP_MAX	
sl@0
  3801
sl@0
  3802
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3803
	
sl@0
  3804
@publishedAll
sl@0
  3805
@externallyDefinedApi
sl@0
  3806
*/
sl@0
  3807
sl@0
  3808
/** @def _SC_ATEXIT_MAX		
sl@0
  3809
sl@0
  3810
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3811
sl@0
  3812
@publishedAll
sl@0
  3813
@externallyDefinedApi
sl@0
  3814
*/
sl@0
  3815
sl@0
  3816
/** @def _SC_IOV_MAX		
sl@0
  3817
sl@0
  3818
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3819
sl@0
  3820
@publishedAll
sl@0
  3821
@externallyDefinedApi
sl@0
  3822
*/
sl@0
  3823
sl@0
  3824
/** @def _SC_PAGE_SIZE		
sl@0
  3825
sl@0
  3826
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3827
sl@0
  3828
@publishedAll
sl@0
  3829
@externallyDefinedApi
sl@0
  3830
*/
sl@0
  3831
sl@0
  3832
/** @def _SC_XOPEN_CRYPT	
sl@0
  3833
sl@0
  3834
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3835
	
sl@0
  3836
@publishedAll
sl@0
  3837
@externallyDefinedApi
sl@0
  3838
*/
sl@0
  3839
sl@0
  3840
/** @def _SC_XOPEN_ENH_I18N	
sl@0
  3841
sl@0
  3842
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3843
sl@0
  3844
@publishedAll
sl@0
  3845
@externallyDefinedApi
sl@0
  3846
*/
sl@0
  3847
sl@0
  3848
/** @def _SC_XOPEN_LEGACY	
sl@0
  3849
sl@0
  3850
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3851
sl@0
  3852
@publishedAll
sl@0
  3853
@externallyDefinedApi
sl@0
  3854
*/
sl@0
  3855
sl@0
  3856
/** @def _SC_XOPEN_REALTIME	
sl@0
  3857
sl@0
  3858
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3859
sl@0
  3860
@publishedAll
sl@0
  3861
@externallyDefinedApi
sl@0
  3862
*/
sl@0
  3863
sl@0
  3864
/** @def _SC_XOPEN_REALTIME_THREADS 
sl@0
  3865
sl@0
  3866
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3867
sl@0
  3868
@publishedAll
sl@0
  3869
@externallyDefinedApi
sl@0
  3870
*/
sl@0
  3871
sl@0
  3872
/** @def _SC_XOPEN_SHM		
sl@0
  3873
sl@0
  3874
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3875
sl@0
  3876
@publishedAll
sl@0
  3877
@externallyDefinedApi
sl@0
  3878
*/
sl@0
  3879
sl@0
  3880
/** @def _SC_XOPEN_STREAMS	
sl@0
  3881
sl@0
  3882
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3883
sl@0
  3884
@publishedAll
sl@0
  3885
@externallyDefinedApi
sl@0
  3886
*/
sl@0
  3887
sl@0
  3888
/** @def _SC_XOPEN_UNIX		
sl@0
  3889
sl@0
  3890
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3891
sl@0
  3892
@publishedAll
sl@0
  3893
@externallyDefinedApi
sl@0
  3894
*/
sl@0
  3895
sl@0
  3896
/** @def _SC_XOPEN_VERSION	
sl@0
  3897
sl@0
  3898
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3899
sl@0
  3900
@publishedAll
sl@0
  3901
@externallyDefinedApi
sl@0
  3902
*/
sl@0
  3903
sl@0
  3904
/** @def _SC_XOPEN_XCU_VERSION	
sl@0
  3905
sl@0
  3906
POSIX-style system configuration variable accessors (for the sysconf function).
sl@0
  3907
sl@0
  3908
@publishedAll
sl@0
  3909
@externallyDefinedApi
sl@0
  3910
*/
sl@0
  3911
sl@0
  3912
/** @def _CS_PATH
sl@0
  3913
sl@0
  3914
Keys for the confstr(3) function.
sl@0
  3915
sl@0
  3916
@publishedAll
sl@0
  3917
@externallyDefinedApi
sl@0
  3918
*/
sl@0
  3919
sl@0
  3920
/** @def _CS_POSIX_V6_ILP32_OFF32_CFLAGS		
sl@0
  3921
sl@0
  3922
Keys for the confstr(3) function.
sl@0
  3923
sl@0
  3924
@publishedAll
sl@0
  3925
@externallyDefinedApi
sl@0
  3926
*/
sl@0
  3927
sl@0
  3928
/** @def _CS_POSIX_V6_ILP32_OFF32_LDFLAGS	
sl@0
  3929
sl@0
  3930
Keys for the confstr(3) function.
sl@0
  3931
sl@0
  3932
@publishedAll
sl@0
  3933
@externallyDefinedApi
sl@0
  3934
*/
sl@0
  3935
sl@0
  3936
/** @def _CS_POSIX_V6_ILP32_OFF32_LIBS		
sl@0
  3937
sl@0
  3938
Keys for the confstr(3) function.
sl@0
  3939
sl@0
  3940
@publishedAll
sl@0
  3941
@externallyDefinedApi
sl@0
  3942
*/
sl@0
  3943
sl@0
  3944
/** @def _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS	
sl@0
  3945
sl@0
  3946
Keys for the confstr(3) function.
sl@0
  3947
sl@0
  3948
@publishedAll
sl@0
  3949
@externallyDefinedApi
sl@0
  3950
*/
sl@0
  3951
sl@0
  3952
/** @def _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS	
sl@0
  3953
sl@0
  3954
Keys for the confstr(3) function.
sl@0
  3955
sl@0
  3956
@publishedAll
sl@0
  3957
@externallyDefinedApi
sl@0
  3958
*/
sl@0
  3959
sl@0
  3960
/** @def _CS_POSIX_V6_LP64_OFF64_CFLAGS		
sl@0
  3961
sl@0
  3962
Keys for the confstr(3) function.
sl@0
  3963
sl@0
  3964
@publishedAll
sl@0
  3965
@externallyDefinedApi
sl@0
  3966
*/
sl@0
  3967
sl@0
  3968
/** @def _CS_POSIX_V6_LP64_OFF64_CFLAGS		
sl@0
  3969
sl@0
  3970
Keys for the confstr(3) function.
sl@0
  3971
sl@0
  3972
@publishedAll
sl@0
  3973
@externallyDefinedApi
sl@0
  3974
*/
sl@0
  3975
sl@0
  3976
/** @def _CS_POSIX_V6_LP64_OFF64_LDFLAGS		
sl@0
  3977
sl@0
  3978
Keys for the confstr(3) function.
sl@0
  3979
sl@0
  3980
@publishedAll
sl@0
  3981
@externallyDefinedApi
sl@0
  3982
*/
sl@0
  3983
sl@0
  3984
/** @def _CS_POSIX_V6_LP64_OFF64_LIBS		
sl@0
  3985
sl@0
  3986
Keys for the confstr(3) function.
sl@0
  3987
sl@0
  3988
@publishedAll
sl@0
  3989
@externallyDefinedApi
sl@0
  3990
*/
sl@0
  3991
sl@0
  3992
/** @def _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS	
sl@0
  3993
sl@0
  3994
Keys for the confstr(3) function.
sl@0
  3995
sl@0
  3996
@publishedAll
sl@0
  3997
@externallyDefinedApi
sl@0
  3998
*/
sl@0
  3999
sl@0
  4000
/** @def optopt
sl@0
  4001
sl@0
  4002
character checked for validity
sl@0
  4003
sl@0
  4004
@publishedAll
sl@0
  4005
@externallyDefinedApi
sl@0
  4006
*/
sl@0
  4007
sl@0
  4008
/** @def opterr
sl@0
  4009
sl@0
  4010
if error message should be printed
sl@0
  4011
sl@0
  4012
@publishedAll
sl@0
  4013
@externallyDefinedApi
sl@0
  4014
*/
sl@0
  4015
sl@0
  4016
/** @def optind
sl@0
  4017
sl@0
  4018
index into parent argv vector
sl@0
  4019
sl@0
  4020
@publishedAll
sl@0
  4021
@externallyDefinedApi
sl@0
  4022
*/
sl@0
  4023
sl@0
  4024
/** @def optarg
sl@0
  4025
sl@0
  4026
argument associated with option
sl@0
  4027
sl@0
  4028
@publishedAll
sl@0
  4029
@externallyDefinedApi
sl@0
  4030
*/
sl@0
  4031
sl@0
  4032
/** @def optreset
sl@0
  4033
sl@0
  4034
reset getopt
sl@0
  4035
sl@0
  4036
@publishedAll
sl@0
  4037
@externallyDefinedApi
sl@0
  4038
*/
sl@0
  4039
sl@0
  4040
/** @typedef typedef __off_t off_t
sl@0
  4041
sl@0
  4042
Used for file sizes.
sl@0
  4043
sl@0
  4044
@publishedAll
sl@0
  4045
@externallyDefinedApi
sl@0
  4046
*/
sl@0
  4047
sl@0
  4048
/** @typedef typedef __gid_t gid_t
sl@0
  4049
sl@0
  4050
Used for group IDs.
sl@0
  4051
sl@0
  4052
@publishedAll
sl@0
  4053
@externallyDefinedApi
sl@0
  4054
*/
sl@0
  4055
sl@0
  4056
/** @typedef typedef __pid_t pid_t
sl@0
  4057
sl@0
  4058
Used for process IDs and process group IDs.
sl@0
  4059
sl@0
  4060
@publishedAll
sl@0
  4061
@externallyDefinedApi
sl@0
  4062
*/
sl@0
  4063
sl@0
  4064
/** @typedef typedef __size_t	size_t	
sl@0
  4065
sl@0
  4066
Used for sizes of objects.
sl@0
  4067
sl@0
  4068
@publishedAll
sl@0
  4069
@externallyDefinedApi
sl@0
  4070
*/
sl@0
  4071
sl@0
  4072
/** @typedef typedef __uid_t	 uid_t
sl@0
  4073
sl@0
  4074
Used for user IDs.
sl@0
  4075
sl@0
  4076
@publishedAll
sl@0
  4077
@externallyDefinedApi
sl@0
  4078
*/
sl@0
  4079
sl@0
  4080
/** @typedef typedef __useconds_t  useconds_t	
sl@0
  4081
sl@0
  4082
Used for time in microseconds.
sl@0
  4083
sl@0
  4084
@publishedAll
sl@0
  4085
@externallyDefinedApi
sl@0
  4086
*/
sl@0
  4087
sl@0
  4088
sl@0
  4089
sl@0
  4090
sl@0
  4091