mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:47:34 +00:00
LibC: add mkfifo(3)
This commit is contained in:
parent
b9619989dd
commit
82ba7d546a
2 changed files with 7 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
@ -63,4 +64,9 @@ int fchmod(int fd, mode_t mode)
|
|||
int rc = syscall(SC_fchmod, fd, mode);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int mkfifo(const char* pathname, mode_t mode)
|
||||
{
|
||||
return mknod(pathname, mode | S_IFIFO, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ mode_t umask(mode_t);
|
|||
int chmod(const char* pathname, mode_t);
|
||||
int fchmod(int fd, mode_t);
|
||||
int mkdir(const char* pathname, mode_t);
|
||||
int mkfifo(const char* pathname, mode_t);
|
||||
|
||||
inline dev_t makedev(unsigned int major, unsigned int minor) { return (minor & 0xffu) | (major << 8u) | ((minor & ~0xffu) << 12u); }
|
||||
inline unsigned int major(dev_t dev) { return (dev & 0xfff00u) >> 8u; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue