Changeset bc56f30 in mainline for uspace/lib/posix/include
- Timestamp:
- 2019-05-27T12:38:26Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0d14c25
- Parents:
- 4d51c60
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-13 16:06:49)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-05-27 12:38:26)
- Location:
- uspace/lib/posix/include/posix
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/ctype.h
r4d51c60 rbc56f30 39 39 #include <libc/ctype.h> 40 40 41 __C_DECLS_BEGIN; 42 41 43 /* Obsolete Functions and Macros */ 42 44 extern int isascii(int c); … … 46 48 #define _toupper(c) ((c) - 'a' + 'A') 47 49 50 __C_DECLS_END; 51 48 52 #endif /* POSIX_CTYPE_H_ */ 49 53 -
uspace/lib/posix/include/posix/dlfcn.h
r4d51c60 rbc56f30 41 41 #define RTLD_LOCAL 0 42 42 43 __C_DECLS_BEGIN; 44 43 45 extern void *dlopen(const char *, int); 44 46 extern void *dlsym(void *, const char *); 45 47 extern int dlclose(void *); 46 48 extern char *dlerror(void); 49 50 __C_DECLS_END; 47 51 48 52 #endif -
uspace/lib/posix/include/posix/fcntl.h
r4d51c60 rbc56f30 38 38 #include <sys/types.h> 39 39 40 #undef O_CREAT41 #undef O_EXCL42 #undef O_TRUNC43 #undef O_APPEND44 #undef O_RDONLY45 #undef O_RDWR46 #undef O_WRONLY47 40 #define O_CREAT 1 48 41 #define O_EXCL 2 … … 54 47 55 48 /* Mask for file access modes. */ 56 #undef O_ACCMODE57 49 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) 58 50 59 51 /* Dummy compatibility flag */ 60 #undef O_NOCTTY61 52 #define O_NOCTTY 0 62 53 63 54 /* fcntl commands */ 64 #undef F_DUPFD65 #undef F_DUPFD_CLOEXEC66 #undef F_GETFD67 #undef F_SETFD68 #undef F_GETFL69 #undef F_SETFL70 #undef F_GETOWN71 #undef F_SETOWN72 #undef F_GETLK73 #undef F_SETLK74 #undef F_SETLKW75 55 #define F_DUPFD 0 /* Duplicate file descriptor. */ 76 56 #define F_DUPFD_CLOEXEC 1 /* Same as F_DUPFD but with FD_CLOEXEC flag set. */ … … 86 66 87 67 /* File descriptor flags used with F_GETFD and F_SETFD. */ 88 #undef FD_CLOEXEC89 68 #define FD_CLOEXEC 1 /* Close on exec. */ 69 70 __C_DECLS_BEGIN; 90 71 91 72 extern int open(const char *pathname, int flags, ...); 92 73 extern int fcntl(int fd, int cmd, ...); 74 75 __C_DECLS_END; 93 76 94 77 #endif /* POSIX_FCNTL_H_ */ -
uspace/lib/posix/include/posix/fnmatch.h
r4d51c60 rbc56f30 36 36 #define POSIX_FNMATCH_H_ 37 37 38 #include <_bits/decls.h> 39 38 40 /* Error Values */ 39 #undef FNM_NOMATCH40 41 #define FNM_NOMATCH 1 41 42 42 43 /* Flags */ 43 #undef FNM_PATHNAME44 #undef FNM_PERIOD45 #undef FNM_NOESCAPE46 44 #define FNM_PATHNAME 1 47 45 #define FNM_PERIOD 2 … … 49 47 50 48 /* GNU Extensions */ 51 #undef FNM_FILE_NAME52 #undef FNM_LEADING_DIR53 #undef FNM_CASEFOLD54 49 #define FNM_FILE_NAME FNM_PATHNAME 55 50 #define FNM_LEADING_DIR 8 56 51 #define FNM_CASEFOLD 16 57 52 53 __C_DECLS_BEGIN; 54 58 55 extern int fnmatch(const char *pattern, const char *string, int flags); 56 57 __C_DECLS_END; 59 58 60 59 #endif /* POSIX_FNMATCH_H_ */ -
uspace/lib/posix/include/posix/locale.h
r4d51c60 rbc56f30 37 37 38 38 #include <stddef.h> 39 #include <_bits/decls.h> 39 40 40 #ifndef __locale_t_defined41 #define __locale_t_defined42 typedef struct __posix_locale *locale_t;43 #endif44 45 #undef LC_ALL46 #undef LC_COLLATE47 #undef LC_CTYPE48 #undef LC_MESSAGES49 #undef LC_MONETARY50 #undef LC_NUMERIC51 #undef LC_TIME52 41 #define LC_ALL 0 53 42 #define LC_COLLATE 1 … … 58 47 #define LC_TIME 6 59 48 60 #undef LC_COLLATE_MASK61 #undef LC_CTYPE_MASK62 #undef LC_MESSAGES_MASK63 #undef LC_MONETARY_MASK64 #undef LC_NUMERIC_MASK65 #undef LC_TIME_MASK66 #undef LC_ALL_MASK67 49 #define LC_COLLATE_MASK (1 << 0) 68 50 #define LC_CTYPE_MASK (1 << 1) … … 74 56 LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) 75 57 76 #undef LC_GLOBAL_LOCALE77 58 #define LC_GLOBAL_LOCALE NULL 59 60 __C_DECLS_BEGIN; 61 62 #ifndef __locale_t_defined 63 #define __locale_t_defined 64 typedef struct __posix_locale *locale_t; 65 #endif 78 66 79 67 struct lconv { … … 114 102 extern locale_t uselocale(locale_t newloc); 115 103 104 __C_DECLS_END; 105 116 106 #endif /* POSIX_LOCALE_H_ */ 117 107 -
uspace/lib/posix/include/posix/pthread.h
r4d51c60 rbc56f30 34 34 35 35 #include <time.h> 36 #include <_bits/decls.h> 37 38 #define PTHREAD_MUTEX_RECURSIVE 1 39 40 #define PTHREAD_MUTEX_INITIALIZER { 0 } 41 42 #define PTHREAD_COND_INITIALIZER { 0 } 43 44 __C_DECLS_BEGIN; 36 45 37 46 typedef void *pthread_t; … … 43 52 typedef int pthread_key_t; 44 53 45 #define PTHREAD_MUTEX_RECURSIVE 146 47 54 typedef struct pthread_mutex { 48 55 int dummy; 49 56 } pthread_mutex_t; 50 51 #define PTHREAD_MUTEX_INITIALIZER { 0 }52 57 53 58 typedef struct { … … 62 67 int dummy; 63 68 } pthread_cond_t; 64 65 #define PTHREAD_COND_INITIALIZER { 0 }66 69 67 70 extern pthread_t pthread_self(void); … … 106 109 extern int pthread_key_create(pthread_key_t *, void (*)(void *)); 107 110 111 __C_DECLS_END; 112 108 113 #endif 109 114 -
uspace/lib/posix/include/posix/pwd.h
r4d51c60 rbc56f30 37 37 38 38 #include <sys/types.h> 39 #include <_bits/decls.h> 40 41 __C_DECLS_BEGIN; 39 42 40 43 struct passwd { … … 58 61 char *buffer, size_t bufsize, struct passwd **result); 59 62 63 __C_DECLS_END; 64 60 65 #endif /* POSIX_PWD_H_ */ 61 66 -
uspace/lib/posix/include/posix/signal.h
r4d51c60 rbc56f30 39 39 #include <ucontext.h> 40 40 41 extern void __posix_default_signal_handler(int signo);42 extern void __posix_hold_signal_handler(int signo);43 extern void __posix_ignore_signal_handler(int signo);44 45 #undef SIG_DFL46 41 #define SIG_DFL ((void (*)(int)) __posix_default_signal_handler) 47 #undef SIG_ERR48 42 #define SIG_ERR ((void (*)(int)) NULL) 49 #undef SIG_HOLD50 43 #define SIG_HOLD ((void (*)(int)) __posix_hold_signal_handler) 51 #undef SIG_IGN52 44 #define SIG_IGN ((void (*)(int)) __posix_ignore_signal_handler) 53 45 54 typedef struct {55 int si_signo;56 int si_code;57 58 int si_errno;59 60 pid_t si_pid;61 uid_t si_uid;62 void *si_addr;63 int si_status;64 65 long si_band;66 67 union sigval si_value;68 } siginfo_t;69 70 struct sigaction {71 void (*sa_handler)(int);72 sigset_t sa_mask;73 int sa_flags;74 void (*sa_sigaction)(int, siginfo_t *, void *);75 };76 77 46 /* Values of sigevent::sigev_notify */ 78 #undef SIGEV_NONE79 #undef SIGEV_SIGNAL80 #undef SIGEV_THREAD81 47 #define SIGEV_NONE 0 82 48 #define SIGEV_SIGNAL 0 83 49 #define SIGEV_THREAD 0 84 50 85 #undef SIGRT_MIN86 #undef SIGRT_MAX87 51 #define SIGRT_MIN 0 88 52 #define SIGRT_MAX 0 89 53 90 #undef SIG_BLOCK91 #undef SIG_UNBLOCK92 #undef SIG_SETMASK93 54 #define SIG_BLOCK 0 94 55 #define SIG_UNBLOCK 1 95 56 #define SIG_SETMASK 2 96 57 97 #undef SA_NOCLDSTOP98 #undef SA_ONSTACK99 #undef SA_RESETHAND100 #undef SA_RESTART101 #undef SA_SIGINFO102 #undef SA_NOCLDWAIT103 #undef SA_NODEFER104 58 #define SA_NOCLDSTOP (1 << 0) 105 59 #define SA_ONSTACK (1 << 1) … … 110 64 #define SA_NODEFER (1 << 6) 111 65 112 #undef SS_ONSTACK113 #undef SS_DISABLE114 66 #define SS_ONSTACK 0 115 67 #define SS_DISABLE 0 116 68 117 #undef MINSIGSTKSZ118 #undef SIGSTKSZ119 69 #define MINSIGSTKSZ 0 120 70 #define SIGSTKSZ 0 71 72 __C_DECLS_BEGIN; 73 74 extern void __posix_default_signal_handler(int signo); 75 extern void __posix_hold_signal_handler(int signo); 76 extern void __posix_ignore_signal_handler(int signo); 77 78 typedef struct { 79 int si_signo; 80 int si_code; 81 82 int si_errno; 83 84 pid_t si_pid; 85 uid_t si_uid; 86 void *si_addr; 87 int si_status; 88 89 long si_band; 90 91 union sigval si_value; 92 } siginfo_t; 93 94 struct sigaction { 95 void (*sa_handler)(int); 96 sigset_t sa_mask; 97 int sa_flags; 98 void (*sa_sigaction)(int, siginfo_t *, void *); 99 }; 121 100 122 101 /* Full POSIX set */ … … 245 224 sigset_t *__restrict__ oset); 246 225 226 __C_DECLS_END; 227 247 228 #endif /* POSIX_SIGNAL_H_ */ 248 229 -
uspace/lib/posix/include/posix/stdio.h
r4d51c60 rbc56f30 45 45 #include <limits.h> 46 46 47 #define P_tmpdir "/tmp" 48 49 #define L_ctermid PATH_MAX 50 51 __C_DECLS_BEGIN; 52 47 53 extern FILE *fdopen(int, const char *); 48 54 extern int fileno(FILE *); 49 55 50 #define P_tmpdir "/tmp"51 52 56 /* Identifying the Terminal */ 53 #undef L_ctermid54 #define L_ctermid PATH_MAX55 57 extern char *ctermid(char *s); 56 58 … … 98 100 extern char *tempnam(const char *dir, const char *pfx); 99 101 102 __C_DECLS_END; 103 100 104 #endif /* POSIX_STDIO_H_ */ 101 105 -
uspace/lib/posix/include/posix/stdlib.h
r4d51c60 rbc56f30 42 42 #include <stddef.h> 43 43 44 __C_DECLS_BEGIN; 45 44 46 /* Environment Access */ 45 47 extern int putenv(char *string); … … 60 62 extern int bsd_getloadavg(double loadavg[], int nelem); 61 63 64 __C_DECLS_END; 65 62 66 #endif // POSIX_STDLIB_H_ 63 67 -
uspace/lib/posix/include/posix/string.h
r4d51c60 rbc56f30 47 47 48 48 #include <libc/mem.h> 49 #ifdef _HELENOS_SOURCE 50 # undef _HELENOS_SOURCE49 50 #define _REALLY_WANT_STRING_H 51 51 #include <libc/string.h> 52 #define _HELENOS_SOURCE 53 #else 54 #include <libc/string.h> 55 #endif 52 53 __C_DECLS_BEGIN; 56 54 57 55 /* Copying and Concatenation */ … … 73 71 74 72 /* Legacy Declarations */ 75 #ifndef POSIX_STRINGS_H_76 73 extern int ffs(int i); 77 74 extern int strcasecmp(const char *s1, const char *s2); 78 75 extern int strncasecmp(const char *s1, const char *s2, size_t n); 79 #endif 76 77 __C_DECLS_END; 80 78 81 79 #endif // POSIX_STRING_H_ -
uspace/lib/posix/include/posix/strings.h
r4d51c60 rbc56f30 39 39 #include <types/common.h> 40 40 41 __C_DECLS_BEGIN; 42 41 43 /* Search Functions */ 42 #ifndef POSIX_STRING_H_43 44 extern int ffs(int i); 44 #endif45 45 46 46 /* String/Array Comparison */ 47 #ifndef POSIX_STRING_H_48 47 extern int strcasecmp(const char *s1, const char *s2); 49 48 extern int strncasecmp(const char *s1, const char *s2, size_t n); 50 #endif51 49 52 50 /* … … 64 62 extern char *rindex(const char *s, int c); 65 63 64 __C_DECLS_END; 65 66 66 #endif // POSIX_STRINGS_H_ 67 67 -
uspace/lib/posix/include/posix/sys/mman.h
r4d51c60 rbc56f30 37 37 38 38 #include <sys/types.h> 39 #include < abi/mm/as.h>39 #include <_bits/decls.h> 40 40 41 #define MAP_FAILED ((void *) -1)41 #define MAP_FAILED ((void *) -1) 42 42 43 43 #define MAP_SHARED (1 << 0) … … 45 45 #define MAP_FIXED (1 << 2) 46 46 #define MAP_ANONYMOUS (1 << 3) 47 #define MAP_ANON MAP_ANONYMOUS47 #define MAP_ANON MAP_ANONYMOUS 48 48 49 #undef PROT_NONE 50 #undef PROT_READ 51 #undef PROT_WRITE 52 #undef PROT_EXEC 53 #define PROT_NONE 0 54 #define PROT_READ AS_AREA_READ 55 #define PROT_WRITE AS_AREA_WRITE 56 #define PROT_EXEC AS_AREA_EXEC 49 #define PROT_NONE 0 50 #define PROT_READ 1 51 #define PROT_WRITE 2 52 #define PROT_EXEC 4 53 54 __C_DECLS_BEGIN; 57 55 58 56 extern void *mmap(void *start, size_t length, int prot, int flags, int fd, … … 60 58 extern int munmap(void *start, size_t length); 61 59 60 __C_DECLS_END; 61 62 62 #endif /* POSIX_SYS_MMAN_H_ */ 63 63 -
uspace/lib/posix/include/posix/sys/stat.h
r4d51c60 rbc56f30 39 39 #include <sys/types.h> 40 40 #include <time.h> 41 #include <_bits/decls.h> 41 42 42 43 /* values are the same as on Linux */ 43 44 44 #undef S_IFMT45 #undef S_IFSOCK46 #undef S_IFLNK47 #undef S_IFREG48 #undef S_IFBLK49 #undef S_IFDIR50 #undef S_IFCHR51 #undef S_IFIFO52 45 #define S_IFMT 0170000 /* all file types */ 53 46 #define S_IFSOCK 0140000 /* socket */ … … 59 52 #define S_IFIFO 0010000 /* FIFO */ 60 53 61 #undef S_ISUID62 #undef S_ISGID63 #undef S_ISVTX64 54 #define S_ISUID 0004000 /* SUID */ 65 55 #define S_ISGID 0002000 /* SGID */ 66 56 #define S_ISVTX 0001000 /* sticky */ 67 57 68 #undef S_IRWXU69 #undef S_IRUSR70 #undef S_IWUSR71 #undef S_IXUSR72 58 #define S_IRWXU 00700 /* owner permissions */ 73 59 #define S_IRUSR 00400 … … 75 61 #define S_IXUSR 00100 76 62 77 #undef S_IRWXG78 #undef S_IRGRP79 #undef S_IWGRP80 #undef S_IXGRP81 63 #define S_IRWXG 00070 /* group permissions */ 82 64 #define S_IRGRP 00040 … … 84 66 #define S_IXGRP 00010 85 67 86 #undef S_IRWXO87 #undef S_IROTH88 #undef S_IWOTH89 #undef S_IXOTH90 68 #define S_IRWXO 00007 /* other permissions */ 91 69 #define S_IROTH 00004 … … 93 71 #define S_IXOTH 00001 94 72 95 #undef S_ISREG96 #undef S_ISDIR97 #undef S_ISCHR98 #undef S_ISBLK99 #undef S_ISFIFO100 #undef S_ISLNK101 #undef S_ISSOCK102 73 #define S_ISREG(m) ((m & S_IFREG) != 0) 103 74 #define S_ISDIR(m) ((m & S_IFDIR) != 0) … … 107 78 #define S_ISLNK(m) ((m & S_IFLNK) != 0) /* symbolic link? (Not in POSIX.1-1996.) */ 108 79 #define S_ISSOCK(m) ((m & S_IFSOCK) != 0) /* socket? (Not in POSIX.1-1996.) */ 80 81 __C_DECLS_BEGIN; 109 82 110 83 struct stat { … … 131 104 extern int mkdir(const char *path, mode_t mode); 132 105 106 __C_DECLS_END; 107 133 108 #endif /* POSIX_SYS_STAT_H */ 134 109 -
uspace/lib/posix/include/posix/sys/time.h
r4d51c60 rbc56f30 35 35 36 36 #include <time.h> 37 #include <_bits/decls.h> 38 39 __C_DECLS_BEGIN; 37 40 38 41 struct timeval { … … 43 46 extern int gettimeofday(struct timeval *, void *); 44 47 48 __C_DECLS_END; 49 45 50 #endif 46 51 -
uspace/lib/posix/include/posix/sys/types.h
r4d51c60 rbc56f30 37 37 #define POSIX_SYS_TYPES_H_ 38 38 39 #include <types/common.h> 39 #include <stddef.h> 40 #include <stdint.h> 41 #include <_bits/ssize_t.h> 42 #include <_bits/decls.h> 43 44 __C_DECLS_BEGIN; 40 45 41 46 typedef unsigned int ino_t; … … 46 51 typedef long blkcnt_t; 47 52 typedef int pid_t; 48 typedef sysarg_tdev_t;53 typedef unsigned long dev_t; 49 54 typedef unsigned int mode_t; 50 55 … … 67 72 typedef long suseconds_t; 68 73 74 __C_DECLS_END; 75 69 76 #endif /* POSIX_SYS_TYPES_H_ */ 70 77 -
uspace/lib/posix/include/posix/sys/wait.h
r4d51c60 rbc56f30 37 37 38 38 #include <sys/types.h> 39 #include <_bits/decls.h> 39 40 40 #undef WIFEXITED41 #undef WEXITSTATUS42 #undef WIFSIGNALED43 #undef WTERMSIG44 41 #define WIFEXITED(status) __posix_wifexited(status) 45 42 #define WEXITSTATUS(status) __posix_wexitstatus(status) 46 43 #define WIFSIGNALED(status) __posix_wifsignaled(status) 47 44 #define WTERMSIG(status) __posix_wtermsig(status) 45 46 __C_DECLS_BEGIN; 48 47 49 48 extern int __posix_wifexited(int status); … … 55 54 extern pid_t waitpid(pid_t pid, int *stat_ptr, int options); 56 55 56 __C_DECLS_END; 57 57 58 #endif /* POSIX_SYS_WAIT_H_ */ 58 59 -
uspace/lib/posix/include/posix/time.h
r4d51c60 rbc56f30 41 41 #include <libc/time.h> 42 42 43 #define CLOCK_REALTIME ((clockid_t) 0) 44 45 #define ASCTIME_BUF_LEN 26 46 47 __C_DECLS_BEGIN; 48 43 49 #ifndef __locale_t_defined 44 50 #define __locale_t_defined … … 46 52 #endif 47 53 48 #ifndef POSIX_SIGNAL_H_49 54 struct sigevent; 50 #endif51 52 #undef CLOCK_REALTIME53 #define CLOCK_REALTIME ((clockid_t) 0)54 55 #define ASCTIME_BUF_LEN 2656 55 57 56 struct itimerspec { … … 97 96 const struct timespec *rqtp, struct timespec *rmtp); 98 97 98 __C_DECLS_END; 99 99 100 #endif // POSIX_TIME_H_ 100 101 -
uspace/lib/posix/include/posix/ucontext.h
r4d51c60 rbc56f30 37 37 38 38 #include <sys/types.h> 39 #include <_bits/decls.h> 40 41 __C_DECLS_BEGIN; 39 42 40 43 typedef int sig_atomic_t; … … 71 74 } ucontext_t; 72 75 76 __C_DECLS_END; 77 73 78 #endif 74 79 -
uspace/lib/posix/include/posix/unistd.h
r4d51c60 rbc56f30 46 46 /* Process Termination */ 47 47 #define _exit exit 48 49 /* Standard Streams */ 50 #define STDIN_FILENO (fileno(stdin)) 51 #define STDOUT_FILENO (fileno(stdout)) 52 #define STDERR_FILENO (fileno(stderr)) 53 54 #define F_OK 0 /* Test for existence. */ 55 #define X_OK 1 /* Test for execute permission. */ 56 #define W_OK 2 /* Test for write permission. */ 57 #define R_OK 4 /* Test for read permission. */ 58 59 __C_DECLS_BEGIN; 48 60 49 61 extern char *optarg; … … 106 118 #endif 107 119 108 /* Standard Streams */109 #undef STDIN_FILENO110 #define STDIN_FILENO (fileno(stdin))111 #undef STDOUT_FILENO112 #define STDOUT_FILENO (fileno(stdout))113 #undef STDERR_FILENO114 #define STDERR_FILENO (fileno(stderr))115 116 120 /* File Accessibility */ 117 #undef F_OK118 #undef X_OK119 #undef W_OK120 #undef R_OK121 #define F_OK 0 /* Test for existence. */122 #define X_OK 1 /* Test for execute permission. */123 #define W_OK 2 /* Test for write permission. */124 #define R_OK 4 /* Test for read permission. */125 121 extern int access(const char *path, int amode); 126 122 … … 171 167 extern unsigned int alarm(unsigned int); 172 168 169 __C_DECLS_END; 170 173 171 #endif /* POSIX_UNISTD_H_ */ 174 172
Note:
See TracChangeset
for help on using the changeset viewer.