2 * Copyright 2004-2007, Haiku Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
18 /* standard file descriptors */
19 #define FSSH_STDIN_FILENO 0
20 #define FSSH_STDOUT_FILENO 1
21 #define FSSH_STDERR_FILENO 2
23 /* lseek() constants */
25 # define FSSH_SEEK_SET 0
28 # define FSSH_SEEK_CUR 1
31 # define FSSH_SEEK_END 2
40 extern int fssh_access(const char *path
, int accessMode
);
42 extern int fssh_chdir(const char *path
);
43 extern int fssh_fchdir(int fd
);
44 extern char *fssh_getcwd(char *buffer
, fssh_size_t size
);
46 extern int fssh_dup(int fd
);
47 extern int fssh_dup2(int fd1
, int fd2
);
48 extern int fssh_close(int fd
);
49 extern int fssh_link(const char *name
, const char *new_name
);
50 extern int fssh_unlink(const char *name
);
51 extern int fssh_rmdir(const char *path
);
53 extern fssh_ssize_t
fssh_readlink(const char *path
, char *buffer
,
54 fssh_size_t bufferSize
);
55 extern int fssh_symlink(const char *from
, const char *to
);
57 extern int fssh_ftruncate(int fd
, fssh_off_t newSize
);
58 extern int fssh_truncate(const char *path
, fssh_off_t newSize
);
59 extern int fssh_ioctl(int fd
, unsigned long op
, ...);
61 extern fssh_ssize_t
fssh_read(int fd
, void *buffer
, fssh_size_t count
);
62 extern fssh_ssize_t
fssh_read_pos(int fd
, fssh_off_t pos
, void *buffer
,
64 extern fssh_ssize_t
fssh_pread(int fd
, void *buffer
, fssh_size_t count
,
66 extern fssh_ssize_t
fssh_write(int fd
, const void *buffer
, fssh_size_t count
);
67 extern fssh_ssize_t
fssh_write_pos(int fd
, fssh_off_t pos
, const void *buffer
,
69 extern fssh_ssize_t
fssh_pwrite(int fd
, const void *buffer
, fssh_size_t count
,
71 extern fssh_off_t
fssh_lseek(int fd
, fssh_off_t offset
, int whence
);
73 extern int fssh_sync(void);
74 extern int fssh_fsync(int fd
);
76 /* access permissions */
77 extern fssh_gid_t
fssh_getegid(void);
78 extern fssh_uid_t
fssh_geteuid(void);
79 extern fssh_gid_t
fssh_getgid(void);
80 extern int fssh_getgroups(int groupSize
, fssh_gid_t groupList
[]);
81 extern fssh_uid_t
fssh_getuid(void);
87 #endif /* _FSSH_UNISTD_H */