Bug 1269501: Part 2 - Add additional libc constants to OS.Constants.libc. r=aswan draft
authorKris Maglione <maglione.k@gmail.com>
Sun, 08 May 2016 20:34:48 -0700
changeset 371150 bcbf14796fcaa31097273df81d64173e824bb45e
parent 371149 2906a6aa3a65fd388db6c388c3fe8d582e02d76f
child 371151 204d9e53ad378726797cd28df4ed8a6f18420891
push id19255
push usermaglione.k@gmail.com
push dateThu, 26 May 2016 01:37:06 +0000
reviewersaswan
bugs1269501
milestone49.0a1
Bug 1269501: Part 2 - Add additional libc constants to OS.Constants.libc. r=aswan MozReview-Commit-ID: H7t3lUvKfY
dom/system/OSFileConstants.cpp
--- a/dom/system/OSFileConstants.cpp
+++ b/dom/system/OSFileConstants.cpp
@@ -9,22 +9,24 @@
 #include "fcntl.h"
 #include "errno.h"
 
 #include "prsystem.h"
 
 #if defined(XP_UNIX)
 #include "unistd.h"
 #include "dirent.h"
+#include "poll.h"
 #include "sys/stat.h"
 #if defined(ANDROID)
 #include <sys/vfs.h>
 #define statvfs statfs
 #else
 #include "sys/statvfs.h"
+#include "sys/wait.h"
 #include <spawn.h>
 #endif // defined(ANDROID)
 #endif // defined(XP_UNIX)
 
 #if defined(XP_LINUX)
 #include <linux/fadvise.h>
 #endif // defined(XP_LINUX)
 
@@ -399,16 +401,19 @@ void CleanupOSFileConstants()
  * separate categories ("errors", "open", etc.),
  * keep properties organized by alphabetical order
  * and #ifdef-away properties that are not portable.
  */
 static const dom::ConstantSpec gLibcProperties[] =
 {
   // Arguments for open
   INT_CONSTANT(O_APPEND),
+#if defined(O_CLOEXEC)
+  INT_CONSTANT(O_CLOEXEC),
+#endif // defined(O_CLOEXEC)
   INT_CONSTANT(O_CREAT),
 #if defined(O_DIRECTORY)
   INT_CONSTANT(O_DIRECTORY),
 #endif // defined(O_DIRECTORY)
 #if defined(O_EVTONLY)
   INT_CONSTANT(O_EVTONLY),
 #endif // defined(O_EVTONLY)
   INT_CONSTANT(O_EXCL),
@@ -436,16 +441,20 @@ static const dom::ConstantSpec gLibcProp
   INT_CONSTANT(O_SYMLINK),
 #endif // defined(O_SYMLINK)
 #if defined(O_SYNC)
   INT_CONSTANT(O_SYNC),
 #endif // defined(O_SYNC)
   INT_CONSTANT(O_TRUNC),
   INT_CONSTANT(O_WRONLY),
 
+#if defined(FD_CLOEXEC)
+  INT_CONSTANT(FD_CLOEXEC),
+#endif // defined(FD_CLOEXEC)
+
 #if defined(AT_EACCESS)
   INT_CONSTANT(AT_EACCESS),
 #endif //defined(AT_EACCESS)
 #if defined(AT_FDCWD)
   INT_CONSTANT(AT_FDCWD),
 #endif //defined(AT_FDCWD)
 #if defined(AT_SYMLINK_NOFOLLOW)
   INT_CONSTANT(AT_SYMLINK_NOFOLLOW),
@@ -477,23 +486,35 @@ static const dom::ConstantSpec gLibcProp
   INT_CONSTANT(S_IXGRP),
   INT_CONSTANT(S_IXUSR),
 
   // seek
   INT_CONSTANT(SEEK_CUR),
   INT_CONSTANT(SEEK_END),
   INT_CONSTANT(SEEK_SET),
 
- // fcntl command values
 #if defined(XP_UNIX)
+  // poll
+  INT_CONSTANT(POLLERR),
+  INT_CONSTANT(POLLHUP),
+  INT_CONSTANT(POLLIN),
+  INT_CONSTANT(POLLNVAL),
+  INT_CONSTANT(POLLOUT),
+
+  // wait
+  INT_CONSTANT(WNOHANG),
+
+  // fcntl command values
   INT_CONSTANT(F_GETLK),
+  INT_CONSTANT(F_SETFD),
+  INT_CONSTANT(F_SETFL),
   INT_CONSTANT(F_SETLK),
   INT_CONSTANT(F_SETLKW),
 
- // flock type values
+  // flock type values
   INT_CONSTANT(F_RDLCK),
   INT_CONSTANT(F_WRLCK),
   INT_CONSTANT(F_UNLCK),
 #endif // defined(XP_UNIX)
   // copyfile
 #if defined(COPYFILE_DATA)
   INT_CONSTANT(COPYFILE_DATA),
   INT_CONSTANT(COPYFILE_EXCL),