Commit 7c35c2be authored by Xavier Deguillard's avatar Xavier Deguillard Committed by Facebook GitHub Bot

portability: define uid_t and gid_t

Summary:
The getuid and getgid are defined as returning uid_t and gid_t. Defining these
types here will prevent downstream consumer from having to redefine these
types for Windows.

(Note: this ignores all push blocking failures!)

Reviewed By: yfeldblum, Orvid

Differential Revision: D23693492

fbshipit-source-id: 1ec9221509bffdd5f6d241c4bc08d7809cdb6162
parent 383456d7
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
// we support, but it's far more compatible with the rest of the windows world // we support, but it's far more compatible with the rest of the windows world
// as an `int` than it would be as a `void*` // as an `int` than it would be as a `void*`
using pid_t = int; using pid_t = int;
using uid_t = int;
using gid_t = int;
// This isn't actually supposed to be defined here, but it's the most // This isn't actually supposed to be defined here, but it's the most
// appropriate place without defining a portability header for stdint.h // appropriate place without defining a portability header for stdint.h
// with just this single typedef. // with just this single typedef.
......
...@@ -115,7 +115,7 @@ int getdtablesize() { ...@@ -115,7 +115,7 @@ int getdtablesize() {
return _getmaxstdio(); return _getmaxstdio();
} }
int getgid() { gid_t getgid() {
return 1; return 1;
} }
...@@ -125,7 +125,7 @@ pid_t getppid() { ...@@ -125,7 +125,7 @@ pid_t getppid() {
return (pid_t)1; return (pid_t)1;
} }
int getuid() { uid_t getuid() {
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment