mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-27 13:00:28 +00:00
Add lchown, lchmod, statvfs, fstatvfs
This commit is contained in:
parent
7b74f6e20e
commit
5a632cf72d
24 changed files with 231 additions and 32 deletions
17
third_party/lua/lunix.c
vendored
17
third_party/lua/lunix.c
vendored
|
@ -2237,9 +2237,12 @@ static int LuaUnixStatfsFfree(lua_State *L) {
|
|||
}
|
||||
|
||||
// unix.Statfs:fsid()
|
||||
// └─→ fsid:int
|
||||
// └─→ x:int, y:int
|
||||
static int LuaUnixStatfsFsid(lua_State *L) {
|
||||
return ReturnInteger(L, GetUnixStatfs(L)->f_fsid);
|
||||
struct statfs *f = GetUnixStatfs(L);
|
||||
lua_pushinteger(L, f->f_fsid.__val[0]);
|
||||
lua_pushinteger(L, f->f_fsid.__val[1]);
|
||||
return 2;
|
||||
}
|
||||
|
||||
// unix.Statfs:namelen()
|
||||
|
@ -2314,10 +2317,14 @@ static int LuaUnixStatfsToString(lua_State *L) {
|
|||
FormatInt64(ibuf, f->f_ffree);
|
||||
luaL_addstring(&b, ibuf);
|
||||
}
|
||||
if (f->f_fsid) {
|
||||
luaL_addstring(&b, ", fsid=");
|
||||
FormatUint64(ibuf, f->f_fsid);
|
||||
if (f->f_fsid.__val[0] || f->f_fsid.__val[1]) {
|
||||
luaL_addstring(&b, ", fsid={");
|
||||
FormatUint64(ibuf, f->f_fsid.__val[0]);
|
||||
luaL_addstring(&b, ibuf);
|
||||
luaL_addstring(&b, ", ");
|
||||
FormatUint64(ibuf, f->f_fsid.__val[1]);
|
||||
luaL_addstring(&b, ibuf);
|
||||
luaL_addstring(&b, "}");
|
||||
}
|
||||
if (f->f_namelen) {
|
||||
luaL_addstring(&b, ", namelen=");
|
||||
|
|
11
third_party/python/Modules/posixmodule.c
vendored
11
third_party/python/Modules/posixmodule.c
vendored
|
@ -13,12 +13,14 @@
|
|||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/sched_param.h"
|
||||
#include "libc/calls/struct/stat.macros.h"
|
||||
#include "libc/calls/struct/statvfs.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/calls/struct/tms.h"
|
||||
#include "libc/calls/struct/utsname.h"
|
||||
#include "libc/calls/struct/winsize.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/calls/sysparam.h"
|
||||
#include "libc/calls/termios.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/dce.h"
|
||||
|
@ -49,6 +51,7 @@
|
|||
#include "libc/sysv/consts/prio.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/sysv/consts/sched.h"
|
||||
#include "libc/sysv/consts/seek.h"
|
||||
#include "libc/sysv/consts/sf.h"
|
||||
#include "libc/sysv/consts/sicode.h"
|
||||
#include "libc/sysv/consts/st.h"
|
||||
|
@ -122,14 +125,6 @@ module os
|
|||
|
||||
#define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#if defined(PATH_MAX) && PATH_MAX > 1024 /* TODO: wut? */
|
||||
#define MAXPATHLEN PATH_MAX
|
||||
#else
|
||||
#define MAXPATHLEN 1024
|
||||
#endif
|
||||
#endif /* MAXPATHLEN */
|
||||
|
||||
#ifdef UNION_WAIT
|
||||
/* Emulate some macros on systems that have a union instead of macros */
|
||||
|
||||
|
|
8
third_party/python/pyconfig.h
vendored
8
third_party/python/pyconfig.h
vendored
|
@ -142,8 +142,8 @@
|
|||
#define HAVE_FSYNC 1
|
||||
#define HAVE_GETENTROPY 1
|
||||
#define HAVE_GETLOADAVG 1
|
||||
#define HAVE_FSTATVFS 1
|
||||
/* #undef HAVE_FEXECVE */
|
||||
/* #undef HAVE_FSTATVFS */
|
||||
/* #undef HAVE_FTIME */
|
||||
/* #define HAVE_GETGROUPS 1 */
|
||||
/* #define HAVE_SETGROUPS 1 */
|
||||
|
@ -205,8 +205,8 @@
|
|||
|
||||
#define HAVE_GETLOGIN 1
|
||||
#define HAVE_LCHOWN 1
|
||||
#define HAVE_LCHMOD 1
|
||||
/* #undef HAVE_LCHFLAGS */
|
||||
/* #undef HAVE_LCHMOD */
|
||||
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
/* #undef HAVE_LIBDL */
|
||||
|
@ -311,6 +311,7 @@
|
|||
#define HAVE_WAIT3 1
|
||||
#define HAVE_WAIT4 1
|
||||
#define HAVE_WAITPID 1
|
||||
#define HAVE_STATVFS 1
|
||||
|
||||
/* #define HAVE_MREMAP 1 */
|
||||
/* #undef HAVE_PLOCK */
|
||||
|
@ -320,7 +321,6 @@
|
|||
/* #undef HAVE_TMPNAM */
|
||||
/* #undef HAVE_TMPNAM_R */
|
||||
/* #undef HAVE_SETPGRP */
|
||||
/* #undef HAVE_STATVFS */
|
||||
/* #undef HAVE_STAT_TV_NSEC2 */
|
||||
/* #undef HAVE_SIGPENDING */
|
||||
/* #undef HAVE_SIGRELSE */
|
||||
|
@ -513,7 +513,7 @@
|
|||
/* #define _Py_MEMORY_SANITIZER */
|
||||
|
||||
/* #define HAVE_DEV_PTMX 1 */
|
||||
/* #define HAVE_OPENPTY 1 */
|
||||
/* #define HAVE_OPENPTY 1 */
|
||||
/* #undef HAVE__GETPTY */
|
||||
/* #undef HAVE_DEV_PTC */
|
||||
/* #define HAVE_FORKPTY 1 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue