ladybird/LibC/sys/stat.h
Andreas Kling c4fce9b3f9 Make stat() work on device files again.
FileDescriptor will now keep a pointer to the original inode even after
opening it resolves to a character device.

Fixed up /bin/ls to display major and minor device numbers instead of size
for device files.
2019-01-31 05:05:57 +01:00

16 lines
490 B
C

#pragma once
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
mode_t umask(mode_t);
int chmod(const char* pathname, mode_t);
int mkdir(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; }
inline unsigned int minor(dev_t dev) { return (dev & 0xffu) | ((dev >> 12u) & 0xfff00u); }
__END_DECLS