Changeset 0ffbed9 in mainline for uspace/lib/posix/unistd.h


Ignore:
Timestamp:
2011-06-19T17:49:29Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5974661
Parents:
f48b637 (diff), 32fb6944 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge libposix.

File:
1 edited

Legend:

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

    rf48b637 r0ffbed9  
    11/*
    22 * Copyright (c) 2011 Jiri Zarevucky
     3 * Copyright (c) 2011 Petr Koupy
    34 * All rights reserved.
    45 *
     
    2627 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2728 */
    28  
     29
     30/** @addtogroup libposix
     31 * @{
     32 */
     33/** @file
     34 */
     35
    2936#ifndef POSIX_UNISTD_H_
    3037#define POSIX_UNISTD_H_
    3138
    3239#include "libc/unistd.h"
     40#include "sys/types.h"
    3341
    34 /* #include <getopt.h> */
     42/* Process Termination */
     43#define _exit exit
    3544
     45/* Option Arguments */
    3646extern char *optarg;
    3747extern int optind, opterr, optopt;
    3848extern int getopt(int, char * const [], const char *);
    3949
    40 extern int isatty(int fd);
     50/* Identifying Terminals */
     51extern int posix_isatty(int fd);
    4152
     53/* Process Identification */
    4254#define getpid task_get_id
     55extern posix_uid_t posix_getuid(void);
     56extern posix_gid_t posix_getgid(void);
    4357
     58/* Standard Streams */
     59#undef STDIN_FILENO
    4460#define STDIN_FILENO (fileno(stdin))
     61#undef STDOUT_FILENO
    4562#define STDOUT_FILENO (fileno(stdout))
     63#undef STDERR_FILENO
    4664#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. */
     75extern int posix_access(const char *path, int amode);
     76
     77/* System Parameters */
     78enum {
     79        _SC_PHYS_PAGES,
     80        _SC_AVPHYS_PAGES,
     81        _SC_PAGESIZE,
     82        _SC_CLK_TCK
     83};
     84extern 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
    4796
    4897#endif /* POSIX_UNISTD_H_ */
    4998
     99/** @}
     100 */
Note: See TracChangeset for help on using the changeset viewer.