2018-10-14 19:28:18 +08:00
|
|
|
/*
|
2022-06-19 21:56:24 +08:00
|
|
|
* Copyright (c) 2006-2022, RT-Thread Development Team
|
2018-10-14 19:28:18 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
2020-12-16 15:25:08 +08:00
|
|
|
* 2020-12-16 Meco Man add usleep
|
2021-09-12 03:34:59 +08:00
|
|
|
* 2021-09-11 Meco Man move functions from dfs_posix.h to unistd.h
|
2018-10-14 19:28:18 +08:00
|
|
|
*/
|
2022-01-08 23:29:41 +08:00
|
|
|
|
2021-07-21 01:43:48 +08:00
|
|
|
#ifndef __SYS_UNISTD_H__
|
|
|
|
#define __SYS_UNISTD_H__
|
2015-05-04 20:35:28 +08:00
|
|
|
|
2021-09-12 03:34:59 +08:00
|
|
|
#include <stddef.h>
|
2022-04-12 01:39:42 +08:00
|
|
|
#include <sys/types.h>
|
2018-03-22 12:09:39 +08:00
|
|
|
|
2022-04-02 16:21:45 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-03-22 12:09:39 +08:00
|
|
|
#define STDIN_FILENO 0 /* standard input file descriptor */
|
|
|
|
#define STDOUT_FILENO 1 /* standard output file descriptor */
|
|
|
|
#define STDERR_FILENO 2 /* standard error file descriptor */
|
|
|
|
|
2022-12-26 14:41:10 +08:00
|
|
|
#define F_OK 0
|
|
|
|
#define X_OK 1
|
|
|
|
#define W_OK 2
|
|
|
|
#define R_OK 4
|
|
|
|
|
2022-01-20 20:53:47 +08:00
|
|
|
unsigned alarm(unsigned __secs);
|
2021-09-12 06:33:46 +08:00
|
|
|
ssize_t read(int fd, void *buf, size_t len);
|
|
|
|
ssize_t write(int fd, const void *buf, size_t len);
|
2021-09-12 03:34:59 +08:00
|
|
|
off_t lseek(int fd, off_t offset, int whence);
|
2022-01-20 20:53:47 +08:00
|
|
|
int pause(void);
|
2021-09-12 03:34:59 +08:00
|
|
|
int fsync(int fildes);
|
2022-01-20 20:53:47 +08:00
|
|
|
long sysconf(int __name);
|
2021-09-12 03:34:59 +08:00
|
|
|
int unlink(const char *pathname);
|
|
|
|
int close(int d);
|
|
|
|
int ftruncate(int fd, off_t length);
|
|
|
|
int rmdir(const char *path);
|
|
|
|
int chdir(const char *path);
|
|
|
|
char *getcwd(char *buf, size_t size);
|
|
|
|
int access(const char *path, int amode);
|
|
|
|
int pipe(int fildes[2]);
|
|
|
|
int isatty(int fd);
|
|
|
|
char *ttyname(int desc);
|
2020-12-04 20:16:56 +08:00
|
|
|
unsigned int sleep(unsigned int seconds);
|
2020-12-16 15:25:08 +08:00
|
|
|
int usleep(useconds_t usec);
|
2021-04-26 14:34:26 +08:00
|
|
|
pid_t gettid(void);
|
2021-02-21 17:25:36 +08:00
|
|
|
pid_t getpid(void);
|
2021-02-21 18:01:29 +08:00
|
|
|
pid_t getppid(void);
|
|
|
|
uid_t getuid(void);
|
|
|
|
uid_t geteuid(void);
|
|
|
|
gid_t getgid(void);
|
|
|
|
gid_t getegid(void);
|
2021-02-21 17:25:36 +08:00
|
|
|
|
2022-04-02 16:21:45 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-05-04 20:35:28 +08:00
|
|
|
#endif /* _SYS_UNISTD_H */
|