Commit b9e76007 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Fix the return type for sysconf in the unistd portability header

Summary: It was incorrectly typed.

Reviewed By: yfeldblum

Differential Revision: D4351015

fbshipit-source-id: b0114d536db66ff4429fa135e9ed7b2051a42d6e
parent 6d042323
...@@ -235,20 +235,20 @@ unsigned int sleep(unsigned int seconds) { ...@@ -235,20 +235,20 @@ unsigned int sleep(unsigned int seconds) {
return 0; return 0;
} }
size_t sysconf(int tp) { long sysconf(int tp) {
switch (tp) { switch (tp) {
case _SC_PAGESIZE: { case _SC_PAGESIZE: {
SYSTEM_INFO inf; SYSTEM_INFO inf;
GetSystemInfo(&inf); GetSystemInfo(&inf);
return (size_t)inf.dwPageSize; return (long)inf.dwPageSize;
} }
case _SC_NPROCESSORS_ONLN: { case _SC_NPROCESSORS_ONLN: {
SYSTEM_INFO inf; SYSTEM_INFO inf;
GetSystemInfo(&inf); GetSystemInfo(&inf);
return (size_t)inf.dwNumberOfProcessors; return (long)inf.dwNumberOfProcessors;
} }
default: default:
return (size_t)-1; return -1L;
} }
} }
......
...@@ -78,7 +78,7 @@ ssize_t readlink(const char* path, char* buf, size_t buflen); ...@@ -78,7 +78,7 @@ ssize_t readlink(const char* path, char* buf, size_t buflen);
int setmode(int fh, int md); int setmode(int fh, int md);
void* sbrk(intptr_t i); void* sbrk(intptr_t i);
unsigned int sleep(unsigned int seconds); unsigned int sleep(unsigned int seconds);
size_t sysconf(int tp); long sysconf(int tp);
long tell(int fh); long tell(int fh);
int truncate(const char* path, off_t len); int truncate(const char* path, off_t len);
int usleep(unsigned int ms); int usleep(unsigned int ms);
......
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