Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/unistd.h

    r59f799b ra16210b5  
    11/*
    22 * Copyright (c) 2011 Jiri Zarevucky
    3  * Copyright (c) 2011 Petr Koupy
    43 * All rights reserved.
    54 *
     
    2726 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2827 */
    29 
    30 /** @addtogroup libposix
    31  * @{
    32  */
    33 /** @file
    34  */
    35 
     28 
    3629#ifndef POSIX_UNISTD_H_
    3730#define POSIX_UNISTD_H_
    3831
    3932#include "libc/unistd.h"
    40 #include "sys/types.h"
    4133
    42 /* Process Termination */
    43 #define _exit exit
     34/* #include <getopt.h> */
    4435
    45 /* Option Arguments */
    4636extern char *optarg;
    4737extern int optind, opterr, optopt;
    4838extern int getopt(int, char * const [], const char *);
    4939
    50 /* Identifying Terminals */
    51 extern int posix_isatty(int fd);
     40extern int isatty(int fd);
    5241
    53 /* Process Identification */
    5442#define getpid task_get_id
    55 extern posix_uid_t posix_getuid(void);
    56 extern posix_gid_t posix_getgid(void);
    5743
    58 /* Standard Streams */
    59 #undef STDIN_FILENO
    6044#define STDIN_FILENO (fileno(stdin))
    61 #undef STDOUT_FILENO
    6245#define STDOUT_FILENO (fileno(stdout))
    63 #undef STDERR_FILENO
    6446#define STDERR_FILENO (fileno(stderr))
    65 
    66 /* File Accessibility */
    67 #undef F_OK
    68 #undef X_OK
    69 #undef W_OK
    70 #undef R_OK
    71 #define F_OK 0 /* Test for existence. */
    72 #define X_OK 1 /* Test for execute permission. */
    73 #define W_OK 2 /* Test for write permission. */
    74 #define R_OK 4 /* Test for read permission. */
    75 extern int posix_access(const char *path, int amode);
    76 
    77 /* System Parameters */
    78 enum {
    79         _SC_PHYS_PAGES,
    80         _SC_AVPHYS_PAGES,
    81         _SC_PAGESIZE,
    82         _SC_CLK_TCK
    83 };
    84 extern long posix_sysconf(int name);
    85 
    86 #ifndef LIBPOSIX_INTERNAL
    87         #define isatty posix_isatty
    88 
    89         #define getuid posix_getuid
    90         #define getgid posix_getgid
    91 
    92         #define access posix_access
    93 
    94         #define sysconf posix_sysconf
    95 #endif
    9647
    9748#endif /* POSIX_UNISTD_H_ */
    9849
    99 /** @}
    100  */
Note: See TracChangeset for help on using the changeset viewer.