summaryrefslogtreecommitdiff
path: root/PACE/pace/unistd.h
blob: 08da8678b49b2280554ebdc90f809bd3b33418ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/* $Id$

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    unistd.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */


#ifndef PACE_UNISTD_H
#define PACE_UNISTD_H


#include "pace/defines.h"
#include "pace/sys/types.h"
#include <stropts.h>


# if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
# endif /* PACE_HAS_CPLUSPLUS */

  PACE_INLINE void pace__exit (int status);

  PACE_INLINE unsigned int pace_alarm (unsigned int seconds);

  PACE_INLINE int pace_access (const char * path, int amode);

  PACE_INLINE int pace_chdir (const char * path);

  PACE_INLINE int pace_chown (const char * path, uid_t owner, pace_gid_t group);

  PACE_INLINE int pace_close (int fildes);

  PACE_INLINE int pace_dup (int fildes);

  PACE_INLINE int pace_dup2 (int fildes, int fildes2);

  #define pace_execl(X)  execl X
  #define pace_execle(X) execle X
  #define pace_execlp(X) execlp X
  /* int execl (const char *path, const char *arg0, ...,
   *            const char *argn, char * (*//*NULL*//*) );
   * int execle (const char *path, char *const arg0[], ...,
   *             const char *argn, char * (*//*NULL*//*), char *const envp[]);
   * int execlp (const char *file, const char  *arg0,  ...,
   *             const char *argn, char * (*//*NULL*//*));
   *
   * PLEASE PAY SPECIAL ATTENTION HERE!
   * This is a macro and requires an additional set of parenthesis
   * surrounding the arguments.
   */

  PACE_INLINE int pace_execv (const char * path, char * const argv[]);

  PACE_INLINE int pace_execve (const char * path, char * const argv[],
                               char * const envp[]);

  PACE_INLINE int pace_execvp (const char * file, char * const argv[]);

  PACE_INLINE int pace_fdatasync (int fildes);

  PACE_INLINE pace_pid_t pace_fork ();

  PACE_INLINE long pace_fpathconf (int fildes, int name);

  PACE_INLINE int pace_fsync (int fildes);

  PACE_INLINE int pace_ftruncate (int fildes, pace_off_t length);

  PACE_INLINE char * pace_getcwd (char * buf, size_t size);

  PACE_INLINE uid_t pace_getegid ();

  PACE_INLINE uid_t pace_geteuid ();

  PACE_INLINE uid_t pace_getgid ();

  PACE_INLINE int pace_getgroups (int gidsetsize, pace_gid_t grouplist[]);

  PACE_INLINE char * pace_getlogin ();

  PACE_INLINE int pace_getlogin_r (char * name, size_t namesize);
  /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */

  PACE_INLINE pace_pid_t pace_getpgrp ();

  PACE_INLINE pace_pid_t pace_getpid ();

  PACE_INLINE pace_pid_t pace_getppid ();

  PACE_INLINE uid_t pace_getuid ();

  #define pace_ioctl(X) ioctl X
  /* int ioctl (int fildes, int request, (*//* args *//*))
   *
   * PLEASE PAY SPECIAL ATTENTION HERE!
   * This is a macro and requires an additional set of parenthesis
   * surrounding the arguments.
   */

  PACE_INLINE int pace_isatty (int fildes);

  PACE_INLINE int pace_link (const char * existing, const char * new_link);

  PACE_INLINE pace_off_t pace_lseek (int fildes, off_t offset, int whence);

  PACE_INLINE long pace_pathconf (const char * path, int name);

  PACE_INLINE int pace_pause ();

  PACE_INLINE int pace_pipe (int fildes[2]);

  PACE_INLINE ssize_t pace_read (int fildes, void * buf, size_t nbyte);

  PACE_INLINE int pace_rmdir (const char * path);

  PACE_INLINE int pace_setgid (pace_gid_t gid);

  PACE_INLINE int pace_setpgid (pace_pid_t pid, pid_t pgid);

  PACE_INLINE pace_pid_t pace_setsid ();

  PACE_INLINE int pace_setuid (uid_t uid);

  PACE_INLINE unsigned pace_sleep (unsigned int seconds);

  PACE_INLINE long pace_sysconf (int name);

  PACE_INLINE char * pace_ttyname (int fildes);

  PACE_INLINE int pace_ttyname_r (int fildes, char * name, size_t namesize);
  /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */

  PACE_INLINE int pace_unlink (const char * path);

  PACE_INLINE ssize_t pace_write (int fildes, const void * buf, size_t nbyte);

# if defined (PACE_HAS_CPLUSPLUS)
}
# endif /* PACE_HAS_CPLUSPLUS */

# if defined (PACE_HAS_INLINE)
# include "unistd.inl"
# endif /* PACE_HAS_INLINE */


#endif /* PACE_UNISTD_H */