![]() |
Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
|


Go to the source code of this file.
Data Structures | |
| struct | stat |
Macros | |
| #define | S_IFMT 0170000 /* Mask for the file type */ |
| #define | S_IFIFO 0010000 /* FIFO */ |
| #define | S_IFCHR 0020000 /* Character device */ |
| #define | S_IFDIR 0040000 /* Directory */ |
| #define | S_IFBLK 0060000 /* Block device */ |
| #define | S_IFREG 0100000 /* Regular file */ |
| #define | S_IFLNK 0120000 /* Symbolic link */ |
| #define | S_IFSOCK 0140000 /* Socket */ |
| #define | S_ISFIFO(m) (((m) &S_IFMT) == S_IFIFO) |
| #define | S_ISCHR(m) (((m) &S_IFMT) == S_IFCHR) |
| #define | S_ISDIR(m) (((m) &S_IFMT) == S_IFDIR) |
| #define | S_ISBLK(m) (((m) &S_IFMT) == S_IFBLK) |
| #define | S_ISREG(m) (((m) &S_IFMT) == S_IFREG) |
| #define | S_ISLNK(m) (((m) &S_IFMT) == S_IFLNK) |
| #define | S_ISSOCK(m) (((m) &S_IFMT) == S_IFSOCK) |
| #define | S_ISUID 0004000 |
| #define | S_ISGID 0002000 |
| #define | S_ISVTX 0001000 |
| #define | S_IRWXU 0000700 |
| #define | S_IRUSR 0000400 |
| #define | S_IWUSR 0000200 |
| #define | S_IXUSR 0000100 |
| #define | S_IRWXG 0000070 |
| #define | S_IRGRP 0000040 |
| #define | S_IWGRP 0000020 |
| #define | S_IXGRP 0000010 |
| #define | S_IRWXO 0000007 |
| #define | S_IROTH 0000004 |
| #define | S_IWOTH 0000002 |
| #define | S_IXOTH 0000001 |
| #define | st_atime st_atim.tv_sec |
| #define | st_mtime st_mtim.tv_sec |
| #define | st_ctime st_ctim.tv_sec |
| #define | UTIME_TO_NOW ((uint32_t) -1) |
| #define | UTIME_NOW ((1l << 30) - 1l) |
| #define | UTIME_OMIT ((1l << 30) - 2l) |
Functions | |
| int | fstat (int fd, struct stat *statbuf) |
| Return information about a file, in the buffer pointed to by statbuf. More... | |
| int | mknod (const char *pathname, mode_t mode, dev_t dev) |
| Create a filesystem node (file, device special file, or named pipe) named pathname, with attributes specified by mode and dev. More... | |
| int | mkfifo (const char *pathname, mode_t mode) |
| Makes a FIFO special file with name pathname. More... | |
| int | mkdir (const char *pathname, mode_t mode) |
| Create a directory named pathname. More... | |
| mode_t | umask (mode_t mask) |
| Set the permission bits withheld from the files the task creates. More... | |
| int | utime (const char *pathname, uint32_t mtime) |
| Replace the time the contents of a file were last written. More... | |
| int | chmod (const char *pathname, mode_t mode) |
| Replace the permission bits of a file. More... | |
| int | stat (const char *pathname, struct stat *statbuf) |
| Return information about the file specified by the pathname, in the buffer pointed to by statbuf. More... | |
| int | lstat (const char *pathname, struct stat *statbuf) |
| Return information about the file specified by the pathname, the way stat() does. Tenok gives a file one name, so there is no link for the call to stop at and the two report the same thing. More... | |
| int | futimens (int fd, const struct timespec times[2]) |
| Stamp the file a descriptor is open on with the times given. Tenok keeps no way back from a descriptor to the file it was opened on, which is what the call would need. More... | |
| int chmod | ( | const char * | pathname, |
| mode_t | mode | ||
| ) |
Replace the permission bits of a file.
| pathname | The pathname of the file. |
| mode | The permission bits to give the file. |
| int | 0 on success and -1 on error, with the reason in errno. |
| int fstat | ( | int | fd, |
| struct stat * | statbuf | ||
| ) |
Return information about a file, in the buffer pointed to by statbuf.
| fd | The file descriptor to provide. |
| int | 0 on success and nonzero error number on error. |
| int futimens | ( | int | fd, |
| const struct timespec | times[2] | ||
| ) |
Stamp the file a descriptor is open on with the times given. Tenok keeps no way back from a descriptor to the file it was opened on, which is what the call would need.
| fd | The descriptor. |
| times | The times to stamp it with. |
| int | -1 with errno set to ENOSYS. |
| int lstat | ( | const char * | pathname, |
| struct stat * | statbuf | ||
| ) |
Return information about the file specified by the pathname, the way stat() does. Tenok gives a file one name, so there is no link for the call to stop at and the two report the same thing.
| pathname | The pathname of the file. |
| statbuf | The buffer for returning the file information. |
| int | 0 on success and nonzero error number on error. |
| int mkdir | ( | const char * | pathname, |
| mode_t | mode | ||
| ) |
Create a directory named pathname.
| pathname | The pathname of the directory to create. |
| mode | The permission bits of the new directory. |
| int | 0 on success and nonzero error number on error. |
| int mkfifo | ( | const char * | pathname, |
| mode_t | mode | ||
| ) |
Makes a FIFO special file with name pathname.
| pathname | The path name to create the new fifo file. |
| mode | The permission bits of the new file. |
| int | 0 on success and nonzero error number on error. |
| int mknod | ( | const char * | pathname, |
| mode_t | mode, | ||
| dev_t | dev | ||
| ) |
Create a filesystem node (file, device special file, or named pipe) named pathname, with attributes specified by mode and dev.
| pathname | The pathname to create the new file. |
| mode | The file type and the permission bits of the new file. |
| dev | The device number, when the file is a device. Not used. |
| int | 0 on success and nonzero error number on error. |
Return information about the file specified by the pathname, in the buffer pointed to by statbuf.
| pathname | The pathname of the file. |
| statbuf | The buffer for returning the file information. |
| int | 0 on success and nonzero error number on error. |
| mode_t umask | ( | mode_t | mask | ) |
Set the permission bits withheld from the files the task creates.
| mask | The bits to withhold from now on. |
| mode_t | The mask that was in effect before the call. |
| int utime | ( | const char * | pathname, |
| uint32_t | mtime | ||
| ) |
Replace the time the contents of a file were last written.
| pathname | The pathname of the file. |
| mtime | Seconds since the epoch, or UTIME_TO_NOW for the present. |
| int | 0 on success and -1 on error, with the reason left in errno. |