Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
unistd.h
Go to the documentation of this file.
1 
4 #ifndef __UNISTD_H__
5 #define __UNISTD_H__
6 
7 #include <stddef.h>
8 #include <stdint.h>
9 #include <sys/types.h>
10 
11 #include "kconfig.h"
12 
13 #define MQ_PRIO_MAX _MQ_PRIO_MAX
14 
15 #define STDIN_FILENO 0 /* Standard input file descriptor */
16 #define STDOUT_FILENO 1 /* Standard output file descriptor */
17 #define STDERR_FILENO 2 /* Standard error file descriptor */
18 
26 unsigned int sleep(unsigned int seconds);
27 
34 int usleep(useconds_t usec);
35 
42 int close(int fd);
43 
51 int dup(int oldfd);
52 
61 int dup2(int oldfd, int newfd);
62 
71 ssize_t read(int fd, void *buf, size_t count);
72 
81 ssize_t write(int fd, const void *buf, size_t count);
82 
91 off_t lseek(int fd, long offset, int whence);
92 
98 int getpid(void);
99 
108 char *getcwd(char *buf, size_t size);
109 
115 int chdir(const char *path);
116 
117 #endif
int chdir(const char *path)
Change working directory.
Definition: file.c:100
int dup2(int oldfd, int newfd)
Perform the same task as dup(), but use the file descriptor number specified by newfd.
Definition: file.c:35
int dup(int oldfd)
Create a copy of the file descriptor oldfd, using the lowest-numbered unused file descriptor for the ...
Definition: file.c:30
char * getcwd(char *buf, size_t size)
Get current working directory.
Definition: file.c:95
unsigned int sleep(unsigned int seconds)
To cause the calling thread to sleep either until the number of real-time seconds specified in second...
Definition: sched.c:40
off_t lseek(int fd, long offset, int whence)
Reposition the file offset of the open file description associated with the file descriptor fd.
Definition: file.c:70
int getpid(void)
Return the ID of the calling task.
int close(int fd)
Close a file descriptor, so that it no longer refers to any file and may be reused.
Definition: file.c:25
ssize_t write(int fd, const void *buf, size_t count)
Write up to count bytes from the buffer starting at buf to the file referred to by the file descripto...
Definition: file.c:55
int usleep(useconds_t usec)
Suspend execution of the calling thread for a given time in microseconds.
Definition: sched.c:46
ssize_t read(int fd, void *buf, size_t count)
Attempt to read up to count bytes from file descriptor fd into the buffer starting at buf.
Definition: file.c:45