Changeset d948095 in mainline for uspace/lib/posix/include
- Timestamp:
- 2012-10-05T08:04:52Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b60faf7
- Parents:
- be1dcc26 (diff), 32b3a12 (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. - Location:
- uspace/lib/posix/include/posix
- Files:
-
- 2 added
- 27 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/errno.h
rbe1dcc26 rd948095 66 66 #undef errno 67 67 #define errno (*__posix_errno()) 68 69 #include "unistd.h"70 68 71 69 extern int *__posix_errno(void); -
uspace/lib/posix/include/posix/fcntl.h
rbe1dcc26 rd948095 72 72 #define FD_CLOEXEC 1 /* Close on exec. */ 73 73 74 #undef open 75 #define open(path, ...) \ 76 ({ \ 77 int rc = open(path, ##__VA_ARGS__); \ 78 if (rc < 0) { \ 79 errno = -rc; \ 80 rc = -1; \ 81 } \ 82 rc; \ 83 }) 84 74 extern int posix_open(const char *pathname, int flags, ...); 85 75 extern int posix_fcntl(int fd, int cmd, ...); 86 76 87 77 #ifndef LIBPOSIX_INTERNAL 88 78 #define fcntl posix_fcntl 79 #define open posix_open 89 80 #endif 90 81 -
uspace/lib/posix/include/posix/signal.h
rbe1dcc26 rd948095 36 36 #define POSIX_SIGNAL_H_ 37 37 38 #include "libc/errno.h"39 38 #include "sys/types.h" 40 39 -
uspace/lib/posix/include/posix/stddef.h
rbe1dcc26 rd948095 36 36 #define POSIX_STDDEF_H_ 37 37 38 #include " libc/stddef.h"38 #include "sys/types.h" 39 39 40 40 #ifndef NULL -
uspace/lib/posix/include/posix/stdio.h
rbe1dcc26 rd948095 39 39 #include "stddef.h" 40 40 #include "unistd.h" 41 #include "libc/ stdio.h"41 #include "libc/io/verify.h" 42 42 #include "sys/types.h" 43 #include " libc/stdarg.h"43 #include "stdarg.h" 44 44 #include "limits.h" 45 46 /* 47 * These are the same as in HelenOS libc. 48 * It would be possible to directly include <stdio.h> but 49 * it is better not to pollute POSIX namespace with other functions 50 * defined in that header. 51 * 52 * Because libposix is always linked with libc, providing only these 53 * forward declarations ought to be enough. 54 */ 55 #define EOF (-1) 56 57 #define BUFSIZ 4096 58 #define SEEK_SET 0 59 #define SEEK_CUR 1 60 #define SEEK_END 2 61 62 typedef struct _IO_FILE FILE; 63 64 extern FILE *stdin; 65 extern FILE *stdout; 66 extern FILE *stderr; 67 68 extern int fgetc(FILE *); 69 extern char *fgets(char *, int, FILE *); 70 71 extern int getchar(void); 72 extern char *gets(char *, size_t); 73 74 extern int fputc(wchar_t, FILE *); 75 extern int fputs(const char *, FILE *); 76 77 extern int putchar(wchar_t); 78 extern int puts(const char *); 79 80 extern int fprintf(FILE *, const char*, ...) PRINTF_ATTRIBUTE(2, 3); 81 extern int vfprintf(FILE *, const char *, va_list); 82 83 extern int printf(const char *, ...) PRINTF_ATTRIBUTE(1, 2); 84 extern int vprintf(const char *, va_list); 85 86 extern int snprintf(char *, size_t , const char *, ...) PRINTF_ATTRIBUTE(3, 4); 87 #ifdef _GNU_SOURCE 88 extern int asprintf(char **, const char *, ...) PRINTF_ATTRIBUTE(2, 3); 89 #endif 90 extern int vsnprintf(char *, size_t, const char *, va_list); 91 92 extern FILE *fopen(const char *, const char *); 93 extern FILE *fdopen(int, const char *); 94 extern int fclose(FILE *); 95 96 extern size_t fread(void *, size_t, size_t, FILE *); 97 extern size_t fwrite(const void *, size_t, size_t, FILE *); 98 99 extern int fseek(FILE *, off64_t, int); 100 extern void rewind(FILE *); 101 extern off64_t ftell(FILE *); 102 extern int feof(FILE *); 103 extern int fileno(FILE *); 104 105 extern int fflush(FILE *); 106 extern int ferror(FILE *); 107 extern void clearerr(FILE *); 108 109 extern void setvbuf(FILE *, void *, int, size_t); 110 111 112 /* POSIX specific stuff. */ 45 113 46 114 /* Identifying the Terminal */ -
uspace/lib/posix/include/posix/stdlib.h
rbe1dcc26 rd948095 37 37 #define POSIX_STDLIB_H_ 38 38 39 #include " libc/stdlib.h"39 #include "sys/types.h" 40 40 41 41 #ifndef NULL … … 50 50 #define _Exit exit 51 51 extern int posix_atexit(void (*func)(void)); 52 extern void exit(int status); 53 extern void abort(void) __attribute__((noreturn)); 52 54 53 55 /* Absolute Value */ -
uspace/lib/posix/include/posix/string.h
rbe1dcc26 rd948095 37 37 #define POSIX_STRING_H_ 38 38 39 #include <mem.h> 40 #include <str.h> 39 #include "sys/types.h" 41 40 42 /* available in str.h 43 * 44 * char *strtok(char *restrict, const char *restrict); 45 * char *strtok_r(char *restrict, const char *restrict, char **restrict); 46 * 47 * available in mem.h 48 * 49 * void *memset(void *, int, size_t); 50 * void *memcpy(void *, const void *, size_t); 51 * void *memmove(void *, const void *, size_t); 52 * 41 /* 53 42 * TODO: not implemented due to missing locale support 54 43 * … … 61 50 #define NULL ((void *) 0) 62 51 #endif 52 53 /* 54 * These are the same as in HelenOS libc. 55 * It would be possible to directly include <str.h> and <mem.h> but 56 * it is better not to pollute POSIX namespace with other functions 57 * defined in that header. 58 * 59 * Because libposix is always linked with libc, providing only these 60 * forward declarations ought to be enough. 61 */ 62 /* From str.h. */ 63 extern char * strtok_r(char *, const char *, char **); 64 extern char * strtok(char *, const char *); 65 66 /* From mem.h */ 67 #define bzero(ptr, len) memset((ptr), 0, (len)) 68 extern void *memset(void *, int, size_t); 69 extern void *memcpy(void *, const void *, size_t); 70 extern void *memmove(void *, const void *, size_t); 71 63 72 64 73 /* Copying and Concatenation */ -
uspace/lib/posix/include/posix/sys/mman.h
rbe1dcc26 rd948095 36 36 #define POSIX_SYS_MMAN_H_ 37 37 38 #include "../libc/sys/mman.h" 38 #include "sys/types.h" 39 #include <abi/mm/as.h> 40 41 #define MAP_FAILED ((void *) -1) 42 43 #define MAP_SHARED (1 << 0) 44 #define MAP_PRIVATE (1 << 1) 45 #define MAP_FIXED (1 << 2) 46 #define MAP_ANONYMOUS (1 << 3) 39 47 40 48 #undef PROT_NONE … … 43 51 #undef PROT_EXEC 44 52 #define PROT_NONE 0 45 #define PROT_READ PROTO_READ 46 #define PROT_WRITE PROTO_WRITE 47 #define PROT_EXEC PROTO_EXEC 53 #define PROT_READ AS_AREA_READ 54 #define PROT_WRITE AS_AREA_WRITE 55 #define PROT_EXEC AS_AREA_EXEC 56 57 extern void *mmap(void *start, size_t length, int prot, int flags, int fd, 58 posix_off_t offset); 59 extern int munmap(void *start, size_t length); 48 60 49 61 #endif /* POSIX_SYS_MMAN_H_ */ -
uspace/lib/posix/include/posix/sys/stat.h
rbe1dcc26 rd948095 37 37 #define POSIX_SYS_STAT_H_ 38 38 39 #include "../libc/sys/stat.h"40 39 #include "types.h" 41 40 #include "../time.h" … … 130 129 extern int posix_chmod(const char *path, mode_t mode); 131 130 extern mode_t posix_umask(mode_t mask); 131 extern int mkdir(const char *, mode_t); 132 132 133 133 #ifndef LIBPOSIX_INTERNAL -
uspace/lib/posix/include/posix/sys/types.h
rbe1dcc26 rd948095 37 37 #define POSIX_SYS_TYPES_H_ 38 38 39 #include "../libc/sys/types.h" 39 #include "libc/sys/types.h" 40 #include "libc/sys/time.h" 40 41 41 42 typedef unsigned int posix_ino_t; -
uspace/lib/posix/include/posix/time.h
rbe1dcc26 rd948095 37 37 #define POSIX_TIME_H_ 38 38 39 #include "libc/time.h"40 39 #include "sys/types.h" 41 40 -
uspace/lib/posix/include/posix/unistd.h
rbe1dcc26 rd948095 37 37 #define POSIX_UNISTD_H_ 38 38 39 #include "libc/unistd.h"40 39 #include "sys/types.h" 40 #include "stddef.h" 41 41 42 42 /* Process Termination */
Note:
See TracChangeset
for help on using the changeset viewer.