mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 20:28:30 +00:00
Polyfill statfs() and fstatfs() on BSD distros
This commit is contained in:
parent
e3fe127ccd
commit
f7ee9d7d99
42 changed files with 968 additions and 287 deletions
2
libc/sysv/consts/SEEK_DATA.S
Normal file
2
libc/sysv/consts/SEEK_DATA.S
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon splice,SEEK_DATA,3,4,3,-1,-1,-1
|
2
libc/sysv/consts/SEEK_HOLE.S
Normal file
2
libc/sysv/consts/SEEK_HOLE.S
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon splice,SEEK_HOLE,4,3,4,-1,-1,-1
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_APPEND,0x0100,0,0,0,0,0
|
||||
.syscon statfs,ST_APPEND,0x0100,0,0,0,0,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_IMMUTABLE,0x0200,0,0,0,0,0
|
||||
.syscon statfs,ST_IMMUTABLE,0x0200,0,0,0,0,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_MANDLOCK,0x0040,0,0,0,0,0
|
||||
.syscon statfs,ST_MANDLOCK,0x0040,0,0,0,0,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_NOATIME,0x0400,0,0,0x04000000,0,0
|
||||
.syscon statfs,ST_NOATIME,0x0040,0x10000000,0x10000000,0x00008000,0x04000000,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_NODEV,4,0,0,0,0x00000010,0
|
||||
.syscon statfs,ST_NODEV,4,16,0,16,16,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_NODIRATIME,0x0800,0,0,0,0,0
|
||||
.syscon statfs,ST_NODIRATIME,0x0800,0,0,0,0,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_NOEXEC,8,0,0,0,4,0
|
||||
.syscon statfs,ST_NOEXEC,8,4,4,4,4,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_NOSUID,2,2,2,2,2,0
|
||||
.syscon statfs,ST_NOSUID,2,8,8,8,8,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_RDONLY,1,1,1,1,1,0
|
||||
.syscon statfs,ST_RDONLY,1,1,1,1,1,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_RELATIME,0x1000,0,0,0,0x00020000,0
|
||||
.syscon statfs,ST_RELATIME,0x1000,0,0,0,0x00020000,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_SYNCHRONOUS,16,0,0,0,2,0
|
||||
.syscon statfs,ST_SYNCHRONOUS,16,2,2,2,2,0
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#include "libc/sysv/consts/syscon.internal.h"
|
||||
.syscon statvfs,ST_WRITE,0x0080,0,0,0,0,0
|
||||
.syscon statfs,ST_WRITE,0x0080,0,0,0,0,0
|
||||
|
|
16
libc/sysv/consts/seek.h
Normal file
16
libc/sysv/consts/seek.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_SEEK_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_SEEK_H_
|
||||
#include "libc/runtime/symbolic.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const int SEEK_DATA;
|
||||
extern const int SEEK_HOLE;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
#define SEEK_DATA SYMBOLIC(SEEK_DATA)
|
||||
#define SEEK_HOLE SYMBOLIC(SEEK_HOLE)
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_SEEK_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue