2 * Copyright 2016 Facebook, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 #include <sys/types.h>
24 // I have no idea what the normal values for these are,
25 // and really don't care what they are. They're only used
26 // within fcntl, so it's not an issue.
27 #define FD_CLOEXEC HANDLE_FLAG_INHERIT
34 #ifdef HAVE_POSIX_FALLOCATE
35 #undef HAVE_POSIX_FALLOCATE
37 #define HAVE_POSIX_FALLOCATE 1
39 // See portability/Unistd.h for why these need to be in a namespace
40 // rather then extern "C".
42 namespace portability {
44 int creat(char const* fn, int pm);
45 int fcntl(int fd, int cmd, ...);
46 int posix_fallocate(int fd, off_t offset, off_t len);
47 int open(char const* fn, int of, int pm = 0);
52 /* using override */ using namespace folly::portability::fcntl;