Changeset 368ee04 in mainline for uspace/lib/c/include
- Timestamp:
- 2017-04-05T18:10:39Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 93ad8166
- Parents:
- 39f892a9 (diff), 2166728 (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/c/include
- Files:
-
- 1 deleted
- 16 edited
- 1 moved
-
dirent.h (modified) (2 diffs)
-
elf/elf_load.h (modified) (1 diff)
-
elf/elf_mod.h (modified) (1 diff)
-
io/logctl.h (modified) (1 diff)
-
ipc/loader.h (modified) (1 diff)
-
ipc/logger.h (modified) (1 diff)
-
ipc/vfs.h (modified) (4 diffs)
-
loader/loader.h (modified) (1 diff)
-
loader/pcb.h (modified) (2 diffs)
-
stdio.h (modified) (3 diffs)
-
stdlib.h (modified) (1 diff)
-
sys/statfs.h (deleted)
-
sys/types.h (modified) (1 diff)
-
task.h (modified) (1 diff)
-
unistd.h (modified) (1 diff)
-
vfs/inbox.h (moved) (moved from uspace/lib/c/include/fcntl.h ) (2 diffs)
-
vfs/vfs.h (modified) (2 diffs)
-
vfs/vfs_mtab.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/dirent.h
r39f892a9 r368ee04 38 38 #define NAME_MAX 256 39 39 40 #include <sys/types.h> 41 40 42 struct dirent { 41 43 char d_name[NAME_MAX + 1]; … … 45 47 int fd; 46 48 struct dirent res; 49 aoff64_t pos; 47 50 } DIR; 48 51 -
uspace/lib/c/include/elf/elf_load.h
r39f892a9 r368ee04 45 45 } elf_info_t; 46 46 47 extern int elf_load( const char *, elf_info_t *);47 extern int elf_load(int, elf_info_t *); 48 48 extern void elf_set_pcb(elf_info_t *, pcb_t *); 49 49 -
uspace/lib/c/include/elf/elf_mod.h
r39f892a9 r368ee04 108 108 109 109 extern const char *elf_error(unsigned int); 110 extern int elf_load_file(const char *, size_t, eld_flags_t, elf_finfo_t *); 110 extern int elf_load_file(int, size_t, eld_flags_t, elf_finfo_t *); 111 extern int elf_load_file_name(const char *, size_t, eld_flags_t, elf_finfo_t *); 111 112 112 113 #endif -
uspace/lib/c/include/io/logctl.h
r39f892a9 r368ee04 38 38 extern int logctl_set_default_level(log_level_t); 39 39 extern int logctl_set_log_level(const char *, log_level_t); 40 extern int logctl_set_root(void); 40 41 41 42 #endif -
uspace/lib/c/include/ipc/loader.h
r39f892a9 r368ee04 42 42 LOADER_GET_TASKID, 43 43 LOADER_SET_CWD, 44 LOADER_SET_P ATHNAME,44 LOADER_SET_PROGRAM, 45 45 LOADER_SET_ARGS, 46 LOADER_ SET_FILES,46 LOADER_ADD_INBOX, 47 47 LOADER_LOAD, 48 48 LOADER_RUN -
uspace/lib/c/include/ipc/logger.h
r39f892a9 r368ee04 49 49 * Followed by: string with full log name. 50 50 */ 51 LOGGER_CONTROL_SET_LOG_LEVEL 51 LOGGER_CONTROL_SET_LOG_LEVEL, 52 /** Set VFS root. 53 * 54 * Returns: error code 55 * Followed by: vfs_pass_handle() request. 56 */ 57 LOGGER_CONTROL_SET_ROOT 52 58 } logger_control_request_t; 53 59 -
uspace/lib/c/include/ipc/vfs.h
r39f892a9 r368ee04 41 41 42 42 #define FS_NAME_MAXLEN 20 43 #define MAX_PATH_LEN ( 64* 1024)43 #define MAX_PATH_LEN (32 * 1024) 44 44 #define MAX_MNTOPTS_LEN 256 45 45 #define PLB_SIZE (2 * MAX_PATH_LEN) … … 63 63 64 64 typedef enum { 65 VFS_IN_OPEN = IPC_FIRST_USER_METHOD, 65 VFS_IN_CLONE = IPC_FIRST_USER_METHOD, 66 VFS_IN_MOUNT, 67 VFS_IN_OPEN, 68 VFS_IN_PUT, 66 69 VFS_IN_READ, 70 VFS_IN_REGISTER, 71 VFS_IN_RENAME, 72 VFS_IN_RESIZE, 73 VFS_IN_STAT, 74 VFS_IN_STATFS, 75 VFS_IN_SYNC, 76 VFS_IN_UNLINK, 77 VFS_IN_UNMOUNT, 78 VFS_IN_WAIT_HANDLE, 79 VFS_IN_WALK, 67 80 VFS_IN_WRITE, 68 VFS_IN_SEEK,69 VFS_IN_TRUNCATE,70 VFS_IN_FSTAT,71 VFS_IN_CLOSE,72 VFS_IN_PING,73 VFS_IN_MOUNT,74 VFS_IN_UNMOUNT,75 VFS_IN_SYNC,76 VFS_IN_REGISTER,77 VFS_IN_MKDIR,78 VFS_IN_UNLINK,79 VFS_IN_RENAME,80 VFS_IN_STAT,81 VFS_IN_DUP,82 VFS_IN_WAIT_HANDLE,83 VFS_IN_MTAB_GET,84 VFS_IN_STATFS85 81 } vfs_in_request_t; 86 82 87 83 typedef enum { 88 VFS_OUT_OPEN_NODE = IPC_FIRST_USER_METHOD, 84 VFS_OUT_CLOSE = IPC_FIRST_USER_METHOD, 85 VFS_OUT_DESTROY, 86 VFS_OUT_IS_EMPTY, 87 VFS_OUT_LINK, 88 VFS_OUT_LOOKUP, 89 VFS_OUT_MOUNTED, 90 VFS_OUT_OPEN_NODE, 89 91 VFS_OUT_READ, 92 VFS_OUT_STAT, 93 VFS_OUT_STATFS, 94 VFS_OUT_SYNC, 95 VFS_OUT_TRUNCATE, 96 VFS_OUT_UNMOUNTED, 90 97 VFS_OUT_WRITE, 91 VFS_OUT_TRUNCATE,92 VFS_OUT_CLOSE,93 VFS_OUT_MOUNT,94 VFS_OUT_MOUNTED,95 VFS_OUT_UNMOUNT,96 VFS_OUT_UNMOUNTED,97 VFS_OUT_SYNC,98 VFS_OUT_STAT,99 VFS_OUT_LOOKUP,100 VFS_OUT_DESTROY,101 VFS_OUT_STATFS,102 98 VFS_OUT_LAST 103 99 } vfs_out_request_t; … … 127 123 128 124 /** 129 * Lookup will succeed only if the object is a root directory. The flag is130 * mutually exclusive with L_FILE and L_MP.125 * Lookup will not cross any mount points. 126 * If the lookup would have to cross a mount point, it returns EXDEV instead. 131 127 */ 132 #define L_ ROOT4128 #define L_DISABLE_MOUNTS 4 133 129 134 130 /** 135 131 * Lookup will succeed only if the object is a mount point. The flag is mutually 136 * exclusive with L_FILE and L_ROOT.132 * exclusive with L_FILE. 137 133 */ 138 134 #define L_MP 8 … … 151 147 152 148 /** 153 * L_LINK is used for linking to an already existing nodes.154 */155 #define L_LINK 64156 157 /**158 149 * L_UNLINK is used to remove leaves from the file system namespace. This flag 159 150 * cannot be passed directly by the client, but will be set by VFS during 160 151 * VFS_UNLINK. 161 152 */ 162 #define L_UNLINK 128153 #define L_UNLINK 64 163 154 164 /** 165 * L_OPEN is used to indicate that the lookup operation is a part of VFS_IN_OPEN 166 * call from the client. This means that the server might allocate some 167 * resources for the opened file. This flag cannot be passed directly by the 168 * client. 155 /* 156 * Walk flags. 169 157 */ 170 #define L_OPEN 256 158 enum { 159 WALK_MAY_CREATE = (1 << 0), 160 WALK_MUST_CREATE = (1 << 1), 161 162 WALK_REGULAR = (1 << 2), 163 WALK_DIRECTORY = (1 << 3), 164 WALK_MOUNT_POINT = (1 << 4), 165 166 WALK_ALL_FLAGS = WALK_MAY_CREATE | WALK_MUST_CREATE | WALK_REGULAR | 167 WALK_DIRECTORY | WALK_MOUNT_POINT, 168 }; 169 170 enum { 171 VFS_MOUNT_BLOCKING = 1, 172 VFS_MOUNT_CONNECT_ONLY = 2, 173 VFS_MOUNT_NO_REF = 4, 174 }; 175 176 enum { 177 MODE_READ = 1, 178 MODE_WRITE = 2, 179 MODE_APPEND = 4, 180 }; 171 181 172 182 #endif -
uspace/lib/c/include/loader/loader.h
r39f892a9 r368ee04 47 47 extern int loader_get_task_id(loader_t *, task_id_t *); 48 48 extern int loader_set_cwd(loader_t *); 49 extern int loader_set_pathname(loader_t *, const char *); 49 extern int loader_set_program(loader_t *, const char *, int); 50 extern int loader_set_program_path(loader_t *, const char *); 50 51 extern int loader_set_args(loader_t *, const char *const[]); 51 extern int loader_ set_files(loader_t *, int *const[]);52 extern int loader_add_inbox(loader_t *, const char *, int); 52 53 extern int loader_load_program(loader_t *); 53 54 extern int loader_run(loader_t *); -
uspace/lib/c/include/loader/pcb.h
r39f892a9 r368ee04 41 41 typedef void (*entry_point_t)(void); 42 42 43 struct pcb_inbox_entry { 44 char *name; 45 int file; 46 }; 47 43 48 /** Program Control Block. 44 49 * … … 60 65 char **argv; 61 66 62 /** Number of preset files. */ 63 unsigned int filc; 67 /** List of inbox files. */ 68 struct pcb_inbox_entry *inbox; 69 int inbox_entries; 64 70 65 71 /* -
uspace/lib/c/include/stdio.h
r39f892a9 r368ee04 44 44 #define EOF (-1) 45 45 46 /** Default size for stream I/O buffers */47 #define BUFSIZ 409648 49 #define DEBUG(fmt, ...) \50 { \51 char _buf[256]; \52 int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \53 if (_n > 0) \54 (void) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) _buf, str_size(_buf)); \55 }56 57 46 #ifndef SEEK_SET 58 47 #define SEEK_SET 0 … … 66 55 #define SEEK_END 2 67 56 #endif 57 58 /** Default size for stream I/O buffers */ 59 #define BUFSIZ 4096 60 61 #define DEBUG(fmt, ...) \ 62 { \ 63 char _buf[256]; \ 64 int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \ 65 if (_n > 0) \ 66 (void) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) _buf, str_size(_buf)); \ 67 } 68 68 69 69 enum _buffer_type { … … 153 153 extern void setbuf(FILE *, void *); 154 154 155 /* Misc file functions */156 extern int rename(const char *, const char *);157 extern int remove(const char *);158 159 155 #endif 160 156 -
uspace/lib/c/include/stdlib.h
r39f892a9 r368ee04 49 49 50 50 extern void abort(void) __attribute__((noreturn)); 51 extern void exit(int) __attribute__((noreturn)); 51 52 52 53 #endif -
uspace/lib/c/include/sys/types.h
r39f892a9 r368ee04 38 38 #include <libarch/types.h> 39 39 40 typedef unsigned int mode_t;41 42 40 /** Relative offset */ 43 41 typedef int64_t off64_t; -
uspace/lib/c/include/task.h
r39f892a9 r368ee04 57 57 const char *const []); 58 58 extern int task_spawnvf(task_id_t *, task_wait_t *, const char *path, 59 const char *const [], int *const []);59 const char *const [], int, int, int); 60 60 extern int task_spawn(task_id_t *, task_wait_t *, const char *path, int, 61 61 va_list ap); -
uspace/lib/c/include/unistd.h
r39f892a9 r368ee04 44 44 #endif 45 45 46 #ifndef SEEK_SET47 #define SEEK_SET 048 #endif49 50 #ifndef SEEK_CUR51 #define SEEK_CUR 152 #endif53 54 #ifndef SEEK_END55 #define SEEK_END 256 #endif57 58 46 #define getpagesize() (PAGE_SIZE) 59 47 60 extern int dup2(int, int);61 62 extern ssize_t write(int, const void *, size_t);63 extern ssize_t read(int, void *, size_t);64 65 extern off64_t lseek(int, off64_t, int);66 extern int ftruncate(int, aoff64_t);67 68 extern int close(int);69 extern int fsync(int);70 extern int unlink(const char *);71 72 extern char *getcwd(char *, size_t);73 extern int rmdir(const char *);74 extern int chdir(const char *);75 76 extern void exit(int) __attribute__((noreturn));77 48 extern int usleep(useconds_t); 78 49 extern unsigned int sleep(unsigned int); -
uspace/lib/c/include/vfs/inbox.h
r39f892a9 r368ee04 1 1 /* 2 * Copyright (c) 20 07 Jakub Jermar2 * Copyright (c) 2013 Jiri Zarevucky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc 29 /** @addtogroup libc 30 30 * @{ 31 */ 32 /** @file 31 */ 32 33 /** 34 * @file 35 * @brief 33 36 */ 34 37 35 #ifndef LIBC_ FCNTL_H_36 #define LIBC_ FCNTL_H_38 #ifndef LIBC_VFS_INBOX_H_ 39 #define LIBC_VFS_INBOX_H_ 37 40 38 #define O_CREAT 1 39 #define O_EXCL 2 40 #define O_TRUNC 4 41 #define O_APPEND 8 42 #define O_RDONLY 16 43 #define O_RDWR 32 44 #define O_WRONLY 64 45 #define O_DESC 128 41 enum { 42 INBOX_MAX_ENTRIES = 256, 43 }; 46 44 47 extern int open(const char *, int, ...); 45 extern int inbox_set(const char *name, int file); 46 extern int inbox_get(const char *name); 47 48 extern int inbox_list(const char **names, int capacity); 48 49 49 50 #endif 50 51 51 /** @} 52 /** 53 * @} 52 54 */ -
uspace/lib/c/include/vfs/vfs.h
r39f892a9 r368ee04 42 42 #include <stdio.h> 43 43 #include <async.h> 44 #include "vfs_mtab.h"45 44 45 #define MAX_OPEN_FILES 128 46 46 47 47 enum vfs_change_state_type { … … 49 49 }; 50 50 51 typedef enum { 52 KIND_FILE, 53 KIND_DIRECTORY, 54 } vfs_file_kind_t; 51 55 52 extern char *vfs_absolutize(const char *, size_t *);53 56 54 extern int vfs_mount(const char *, const char *, const char *, const char *, 55 unsigned int, unsigned int); 56 extern int vfs_unmount(const char *); 57 struct stat { 58 fs_handle_t fs_handle; 59 service_id_t service_id; 60 fs_index_t index; 61 unsigned int lnkcnt; 62 bool is_file; 63 bool is_directory; 64 aoff64_t size; 65 service_id_t service; 66 }; 67 68 struct statfs { 69 char fs_name[FS_NAME_MAXLEN + 1]; 70 uint32_t f_bsize; /* fundamental file system block size */ 71 uint64_t f_blocks; /* total data blocks in file system */ 72 uint64_t f_bfree; /* free blocks in fs */ 73 }; 57 74 58 75 extern int vfs_fhandle(FILE *, int *); 59 76 60 extern int vfs_fd_wait(void); 61 extern int vfs_get_mtab_list(list_t *mtab_list); 62 77 extern char *vfs_absolutize(const char *, size_t *); 78 extern int vfs_clone(int, int, bool); 79 extern int vfs_cwd_get(char *path, size_t); 80 extern int vfs_cwd_set(const char *path); 63 81 extern async_exch_t *vfs_exchange_begin(void); 64 82 extern void vfs_exchange_end(async_exch_t *); 83 extern int vfs_link(int, const char *, vfs_file_kind_t, int *); 84 extern int vfs_link_path(const char *, vfs_file_kind_t, int *); 85 extern int vfs_lookup(const char *, int); 86 extern int vfs_lookup_open(const char *, int, int); 87 extern int vfs_mount_path(const char *, const char *, const char *, 88 const char *, unsigned int, unsigned int); 89 extern int vfs_mount(int, const char *, service_id_t, const char *, unsigned, 90 unsigned, int *); 91 extern int vfs_open(int, int); 92 extern int vfs_pass_handle(async_exch_t *, int, async_exch_t *); 93 extern int vfs_put(int); 94 extern ssize_t vfs_read(int, aoff64_t *, void *, size_t); 95 extern int vfs_read_short(int, aoff64_t, void *, size_t, ssize_t *); 96 extern int vfs_receive_handle(bool); 97 extern int vfs_rename_path(const char *, const char *); 98 extern int vfs_resize(int, aoff64_t); 99 extern int vfs_root(void); 100 extern void vfs_root_set(int); 101 extern int vfs_stat(int, struct stat *); 102 extern int vfs_stat_path(const char *, struct stat *); 103 extern int vfs_statfs(int, struct statfs *); 104 extern int vfs_statfs_path(const char *, struct statfs *); 105 extern int vfs_sync(int); 106 extern int vfs_unlink(int, const char *, int); 107 extern int vfs_unlink_path(const char *); 108 extern int vfs_unmount(int); 109 extern int vfs_unmount_path(const char *); 110 extern int vfs_walk(int, const char *, int); 111 extern ssize_t vfs_write(int, aoff64_t *, const void *, size_t); 112 extern int vfs_write_short(int, aoff64_t, const void *, size_t, ssize_t *); 65 113 66 114 #endif -
uspace/lib/c/include/vfs/vfs_mtab.h
r39f892a9 r368ee04 43 43 link_t link; 44 44 char mp[MAX_PATH_LEN]; 45 char opts[MAX_MNTOPTS_LEN];46 45 char fs_name[FS_NAME_MAXLEN]; 47 unsigned int instance;48 46 service_id_t service_id; 49 47 } mtab_ent_t; 48 49 extern int vfs_get_mtab_list(list_t *); 50 50 51 51 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
