#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include "kconfig.h"
Go to the source code of this file.
|
|
#define | MQ_PRIO_MAX _MQ_PRIO_MAX |
| |
|
#define | STDIN_FILENO 0 /* Standard input file descriptor */ |
| |
|
#define | STDOUT_FILENO 1 /* Standard output file descriptor */ |
| |
|
#define | STDERR_FILENO 2 /* Standard error file descriptor */ |
| |
|
| unsigned int | sleep (unsigned int seconds) |
| | To cause the calling thread to sleep either until the number of real-time seconds specified in seconds have elapsed or until a signal arrives which is not ignored. More...
|
| |
| int | usleep (useconds_t usec) |
| | Suspend execution of the calling thread for a given time in microseconds. More...
|
| |
| int | close (int fd) |
| | Close a file descriptor, so that it no longer refers to any file and may be reused. More...
|
| |
| int | dup (int oldfd) |
| | Create a copy of the file descriptor oldfd, using the lowest-numbered unused file descriptor for the new descriptor. More...
|
| |
| int | dup2 (int oldfd, int newfd) |
| | Perform the same task as dup(), but use the file descriptor number specified by newfd. More...
|
| |
| 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. More...
|
| |
| 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 descriptor fd. More...
|
| |
| off_t | lseek (int fd, long offset, int whence) |
| | Reposition the file offset of the open file description associated with the file descriptor fd. More...
|
| |
| int | getpid (void) |
| | Return the ID of the calling task. More...
|
| |
| char * | getcwd (char *buf, size_t size) |
| | Get current working directory. More...
|
| |
| int | chdir (const char *path) |
| | Change working directory. More...
|
| |
◆ chdir()
| int chdir |
( |
const char * |
path | ) |
|
Change working directory.
- Parameters
-
| path | Pathname of the new working directory. |
- Return values
-
| int | 0 on success and nonzero error number on error. |
◆ close()
Close a file descriptor, so that it no longer refers to any file and may be reused.
- Parameters
-
| fd | The file descriptor to provide. |
- Return values
-
| int | 0 on success and nonzero error number on error. |
◆ dup()
Create a copy of the file descriptor oldfd, using the lowest-numbered unused file descriptor for the new descriptor.
- Parameters
-
| oldfd | The file descriptor to duplicate. |
- Return values
-
| int | New file descriptor on success and nonzero error number on error. |
◆ dup2()
| int dup2 |
( |
int |
oldfd, |
|
|
int |
newfd |
|
) |
| |
Perform the same task as dup(), but use the file descriptor number specified by newfd.
- Parameters
-
| oldfd | The file descriptor to duplicate. |
| newfd | The number to specify the new file descriptor. |
- Return values
-
| int | New file descriptor on success and nonzero error number on error. |
◆ getcwd()
| char* getcwd |
( |
char * |
buf, |
|
|
size_t |
size |
|
) |
| |
Get current working directory.
- Parameters
-
| buf | Buffer space for storing path of the current working space. |
| size | Size of the buffer space. |
- Return values
-
| char | *: The function returns a pointer to a string containing the pathname of current working directory if success; otherwise it returns NULL. |
◆ getpid()
Return the ID of the calling task.
- Parameters
-
- Return values
-
◆ lseek()
| off_t lseek |
( |
int |
fd, |
|
|
long |
offset, |
|
|
int |
whence |
|
) |
| |
Reposition the file offset of the open file description associated with the file descriptor fd.
- Parameters
-
| fd | The file descriptor to provide. |
| offset | The new offset to the position specified by whence. |
| whence | The start position of the new offset. |
- Return values
-
| int | 0 on success and nonzero error number on error. |
◆ read()
| 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.
- Parameters
-
| fd | The file descriptor to provide. |
| buf | The memory space for storing read data. |
| count | The number of bytes to read. |
- Return values
-
| int | 0 on success and nonzero error number on error. |
◆ sleep()
| unsigned int sleep |
( |
unsigned int |
seconds | ) |
|
To cause the calling thread to sleep either until the number of real-time seconds specified in seconds have elapsed or until a signal arrives which is not ignored.
- Parameters
-
| seconds | The sleep seconds to provide. |
- Return values
-
| int | 0 on success and nonzero error number on error. |
◆ usleep()
| int usleep |
( |
useconds_t |
usec | ) |
|
Suspend execution of the calling thread for a given time in microseconds.
- Parameters
-
| usec | The sleep microseconds to provide. |
- Return values
-
| int | 0 on success and nonzero error number on error. |
◆ write()
| 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 descriptor fd.
- Parameters
-
| fd | The file descriptor to provide. |
| buf | The data to write. |
| count | The number of bytes to write. |
- Return values
-
| int | 0 on success and nonzero error number on error. |