From b9e7600760578ea5bd09fbfd1d98a91663a57c34 Mon Sep 17 00:00:00 2001
From: Christopher Dykes <cdykes@fb.com>
Date: Wed, 21 Dec 2016 13:04:24 -0800
Subject: [PATCH] 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
---
 folly/portability/Unistd.cpp | 8 ++++----
 folly/portability/Unistd.h   | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/folly/portability/Unistd.cpp b/folly/portability/Unistd.cpp
index df382dca1..c83688a0c 100755
--- a/folly/portability/Unistd.cpp
+++ b/folly/portability/Unistd.cpp
@@ -235,20 +235,20 @@ unsigned int sleep(unsigned int seconds) {
   return 0;
 }
 
-size_t sysconf(int tp) {
+long sysconf(int tp) {
   switch (tp) {
     case _SC_PAGESIZE: {
       SYSTEM_INFO inf;
       GetSystemInfo(&inf);
-      return (size_t)inf.dwPageSize;
+      return (long)inf.dwPageSize;
     }
     case _SC_NPROCESSORS_ONLN: {
       SYSTEM_INFO inf;
       GetSystemInfo(&inf);
-      return (size_t)inf.dwNumberOfProcessors;
+      return (long)inf.dwNumberOfProcessors;
     }
     default:
-      return (size_t)-1;
+      return -1L;
   }
 }
 
diff --git a/folly/portability/Unistd.h b/folly/portability/Unistd.h
index 364fca9d2..6e99fdfda 100755
--- a/folly/portability/Unistd.h
+++ b/folly/portability/Unistd.h
@@ -78,7 +78,7 @@ ssize_t readlink(const char* path, char* buf, size_t buflen);
 int setmode(int fh, int md);
 void* sbrk(intptr_t i);
 unsigned int sleep(unsigned int seconds);
-size_t sysconf(int tp);
+long sysconf(int tp);
 long tell(int fh);
 int truncate(const char* path, off_t len);
 int usleep(unsigned int ms);
-- 
2.26.2