blob: 45d4f7f1bf5cd33d2ed6eabd71902b57c05505a3 [file] [log] [blame]
Calin Juravlefe317a32014-02-21 15:11:03 +00001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
Calin Juravled4934a72014-02-24 16:13:50 +000017#include <ftw.h>
Calin Juravlefe317a32014-02-21 15:11:03 +000018#include <stdlib.h>
19
Elliott Hughes31165ed2014-09-23 17:34:29 -070020// Delegation will work in these cases because all the transitive dependencies
21// are already 64-bit ready. In particular, we don't have non-O_LARGEFILE
22// open (our open is actually open64) and stat and stat64 are the same.
23int mkstemp64(char* path) {
24 return mkstemp(path);
25}
26int mkostemp64(char* path, int flags) {
27 return mkostemp(path, flags);
28}
29int mkstemps64(char* path, int suffix_length) {
30 return mkstemps(path, suffix_length);
31}
32int mkostemps64(char* path, int suffix_length, int flags) {
33 return mkostemps(path, suffix_length, flags);
Calin Juravlefe317a32014-02-21 15:11:03 +000034}
Calin Juravled4934a72014-02-24 16:13:50 +000035
36typedef int (*ftw_fn)(const char*, const struct stat*, int);
37typedef int (*nftw_fn)(const char*, const struct stat*, int, struct FTW*);
38
39int ftw64(const char *dirpath,
40 int (*fn)(const char*, const struct stat64*, int), int nopenfd) {
41 return ftw(dirpath, reinterpret_cast<ftw_fn>(fn), nopenfd);
42}
43
44int nftw64(const char * dirpath,
45 int (*fn)(const char*, const struct stat64*, int, struct FTW*),
46 int nopenfd, int flags) {
47 return nftw(dirpath, reinterpret_cast<nftw_fn>(fn), nopenfd, flags);
48}