Skip to content

Commit e5ebcc2

Browse files
committed
Add more O_* constants
1 parent 05ef6b9 commit e5ebcc2

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixConstants.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ public final class PosixConstants {
115115
public static final OptionalIntConstant O_RSYNC;
116116
public static final OptionalIntConstant O_TMPFILE;
117117
public static final OptionalIntConstant O_DIRECTORY;
118+
public static final OptionalIntConstant O_BINARY;
119+
public static final OptionalIntConstant O_TEXT;
120+
public static final OptionalIntConstant O_XATTR;
121+
public static final OptionalIntConstant O_LARGEFILE;
122+
public static final OptionalIntConstant O_SHLOCK;
123+
public static final OptionalIntConstant O_EXLOCK;
124+
public static final OptionalIntConstant O_EXEC;
125+
public static final OptionalIntConstant O_SEARCH;
126+
public static final OptionalIntConstant O_PATH;
127+
public static final OptionalIntConstant O_TTY_INIT;
118128
public static final MandatoryIntConstant S_IFMT;
119129
public static final MandatoryIntConstant S_IFSOCK;
120130
public static final MandatoryIntConstant S_IFLNK;
@@ -369,6 +379,16 @@ public final class PosixConstants {
369379
O_RSYNC = reg.createOptionalInt("O_RSYNC");
370380
O_TMPFILE = reg.createOptionalInt("O_TMPFILE");
371381
O_DIRECTORY = reg.createOptionalInt("O_DIRECTORY");
382+
O_BINARY = reg.createOptionalInt("O_BINARY");
383+
O_TEXT = reg.createOptionalInt("O_TEXT");
384+
O_XATTR = reg.createOptionalInt("O_XATTR");
385+
O_LARGEFILE = reg.createOptionalInt("O_LARGEFILE");
386+
O_SHLOCK = reg.createOptionalInt("O_SHLOCK");
387+
O_EXLOCK = reg.createOptionalInt("O_EXLOCK");
388+
O_EXEC = reg.createOptionalInt("O_EXEC");
389+
O_SEARCH = reg.createOptionalInt("O_SEARCH");
390+
O_PATH = reg.createOptionalInt("O_PATH");
391+
O_TTY_INIT = reg.createOptionalInt("O_TTY_INIT");
372392
S_IFMT = reg.createMandatoryInt("S_IFMT");
373393
S_IFSOCK = reg.createMandatoryInt("S_IFSOCK");
374394
S_IFLNK = reg.createMandatoryInt("S_IFLNK");
@@ -561,7 +581,7 @@ public final class PosixConstants {
561581
SIZEOF_STRUCT_SOCKADDR_UN_SUN_PATH = reg.createMandatoryInt("SIZEOF_STRUCT_SOCKADDR_UN_SUN_PATH");
562582

563583
openFlags = new IntConstant[]{O_ACCMODE, O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_TRUNC, O_APPEND, O_NONBLOCK, O_NOCTTY, O_NDELAY, O_DSYNC, O_CLOEXEC, O_SYNC, O_DIRECT, O_RSYNC,
564-
O_TMPFILE, O_DIRECTORY};
584+
O_TMPFILE, O_DIRECTORY, O_BINARY, O_TEXT, O_XATTR, O_LARGEFILE, O_SHLOCK, O_EXLOCK, O_EXEC, O_SEARCH, O_PATH, O_TTY_INIT};
565585
fileType = new IntConstant[]{S_IFMT, S_IFSOCK, S_IFLNK, S_IFREG, S_IFBLK, S_IFDIR, S_IFCHR, S_IFIFO};
566586
mmapFlags = new IntConstant[]{MAP_SHARED, MAP_PRIVATE, MAP_ANONYMOUS, MAP_DENYWRITE, MAP_EXECUTABLE};
567587
mmapProtection = new IntConstant[]{PROT_NONE, PROT_READ, PROT_WRITE, PROT_EXEC};

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PosixConstantsLinux.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ static void getConstants(PosixConstants.Registry constants) {
8787
constants.put("O_RSYNC", 0x00101000);
8888
constants.put("O_TMPFILE", 0x00410000);
8989
constants.put("O_DIRECTORY", 0x00010000);
90+
constants.put("O_LARGEFILE", 0x00000000);
91+
constants.put("O_PATH", 0x00200000);
9092
constants.put("S_IFMT", 0x0000F000);
9193
constants.put("S_IFSOCK", 0x0000C000);
9294
constants.put("S_IFLNK", 0x0000A000);

scripts/gen_native_cfg.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@
160160
* x O_RSYNC
161161
* x O_TMPFILE
162162
* x O_DIRECTORY
163+
* x O_BINARY
164+
* x O_TEXT
165+
* x O_XATTR
166+
* x O_LARGEFILE
167+
* x O_SHLOCK
168+
* x O_EXLOCK
169+
* x O_EXEC
170+
* x O_SEARCH
171+
* x O_PATH
172+
* x O_TTY_INIT
163173
164174
[fileType]
165175
u x S_IFMT

0 commit comments

Comments
 (0)