summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorGabor Kelemen <gabor.kelemen.extern@allotropia.de>2023-08-19 00:04:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-08-30 09:19:55 +0200
commit252132d9752964a4aa82567b6a3ca8cd7df5ccfb (patch)
treeb08879602ba1179e0336b6acec9abb7725e9419f /sal
parent9e53afb9cad0e6ed66904ac38b61d1450e12f01d (diff)
tdf#146619 Remove unused includes from sal/osl/unx
Change-Id: Icc9cd3410cde2589ea51385c651243e11cc2f1d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155855 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/IwyuFilter_sal.yaml32
-rw-r--r--sal/inc/oslrandom.h2
-rw-r--r--sal/osl/unx/backtraceapi.cxx1
-rw-r--r--sal/osl/unx/file.cxx13
-rw-r--r--sal/osl/unx/file_misc.cxx11
-rw-r--r--sal/osl/unx/file_stat.cxx3
-rw-r--r--sal/osl/unx/file_url.cxx6
-rw-r--r--sal/osl/unx/file_volume.cxx8
-rw-r--r--sal/osl/unx/interlck.cxx2
-rw-r--r--sal/osl/unx/module.cxx4
-rw-r--r--sal/osl/unx/mutex.cxx1
-rw-r--r--sal/osl/unx/nlsupport.cxx8
-rw-r--r--sal/osl/unx/nlsupport.hxx1
-rw-r--r--sal/osl/unx/pipe.cxx4
-rw-r--r--sal/osl/unx/process.cxx9
-rw-r--r--sal/osl/unx/process_impl.cxx1
-rw-r--r--sal/osl/unx/profile.cxx9
-rw-r--r--sal/osl/unx/random.cxx4
-rw-r--r--sal/osl/unx/readwrite_helper.cxx3
-rw-r--r--sal/osl/unx/salinit.cxx1
-rw-r--r--sal/osl/unx/security.cxx9
-rw-r--r--sal/osl/unx/signal.cxx7
-rw-r--r--sal/osl/unx/socket.cxx4
-rw-r--r--sal/osl/unx/system.cxx7
-rw-r--r--sal/osl/unx/system.hxx1
-rw-r--r--sal/osl/unx/tempfile.cxx3
-rw-r--r--sal/osl/unx/thread.cxx3
-rw-r--r--sal/osl/unx/time.cxx1
-rw-r--r--sal/osl/unx/uunxapi.cxx2
29 files changed, 63 insertions, 97 deletions
diff --git a/sal/IwyuFilter_sal.yaml b/sal/IwyuFilter_sal.yaml
index 0bfa0a3d07a4..0871e1c82d46 100644
--- a/sal/IwyuFilter_sal.yaml
+++ b/sal/IwyuFilter_sal.yaml
@@ -7,9 +7,14 @@ excludelist:
sal/osl/unx/backtrace.h:
# needed for the "shadow" backtrace API
- execinfo.h
+ sal/osl/unx/nlsupport.hxx:
+ # Needed on MACOSX
+ - #include <rtl/ustring.hxx>
sal/osl/unx/system.hxx:
# needed for the define pthread_testcancel() to work
- pthread.h
+ # needed for the INIT_GROUPS macro to work
+ - grp.h
sal/android/uthash.h:
# needed for defines to work / somehow on Linux there is a warning about android-related file
- string.h
@@ -34,3 +39,30 @@ excludelist:
sal/qa/rtl/textenc/rtl_textcvt.cxx:
# Required in C++20 mode.
- o3tl/cppunittraitshelper.hxx
+ sal/osl/unx/file.cxx:
+ # Needed for macxp_resolveAlias on MACOSX
+ - system.hxx
+ sal/osl/unx/file_misc.cxx:
+ # Needed for macxp_resolveAlias on MACOSX
+ - system.hxx
+ sal/osl/unx/file_stat.cxx:
+ # Needed for macxp_resolveAlias on MACOSX
+ - system.hxx
+ sal/osl/unx/file_volume.cxx:
+ # Needed for macxp_resolveAlias on MACOSX
+ - system.hxx
+ # Needed for HAVE_STATFS_H cases
+ - osl/thread.h
+ sal/osl/unx/backtraceapi.cxx:
+ # needed for the "shadow" backtrace API
+ - backtrace.h
+ sal/osl/unx/signal.cxx:
+ # needed for the "shadow" backtrace API
+ - backtrace.h
+ sal/osl/unx/thread.cxx:
+ # needed for older glibc
+ - sys/syscall.h
+ - o3tl/safeint.hxx
+ sal/osl/unx/uunxapi.cxx:
+ # Needed for macxp_resolveAlias on MACOSX
+ - system.hxx
diff --git a/sal/inc/oslrandom.h b/sal/inc/oslrandom.h
index 8f5dfffae426..b65878433225 100644
--- a/sal/inc/oslrandom.h
+++ b/sal/inc/oslrandom.h
@@ -10,7 +10,7 @@
#ifndef INCLUDED_SAL_INC_INTERNAL_OSLRANDOM_H
#define INCLUDED_SAL_INC_INTERNAL_OSLRANDOM_H
-#include <stddef.h>
+#include <cstddef>
#if defined __cplusplus
extern "C" {
diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx
index a4cec46ca95b..4c1f25b886ae 100644
--- a/sal/osl/unx/backtraceapi.cxx
+++ b/sal/osl/unx/backtraceapi.cxx
@@ -54,7 +54,6 @@ std::unique_ptr<sal::BacktraceState> sal::backtrace_get(sal_uInt32 maxDepth)
#include <vector>
#include <osl/process.h>
#include <rtl/strbuf.hxx>
-#include <osl/mutex.hxx>
#include <o3tl/lru_map.hxx>
#include "file_url.hxx"
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 4b1313586e81..a831221a3c36 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -19,14 +19,10 @@
#include <config_features.h>
#include <o3tl/safeint.hxx>
-#include <o3tl/string_view.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <sal/log.hxx>
-#include <osl/diagnose.h>
-#include <osl/file.hxx>
#include <osl/detail/file.h>
-#include <rtl/alloc.h>
-#include <rtl/byteseq.hxx>
+#include <rtl/byteseq.h>
#include <rtl/string.hxx>
#include "system.hxx"
@@ -39,14 +35,13 @@
#include <algorithm>
#include <atomic>
-#include <vector>
#include <cassert>
+#include <fcntl.h>
#include <limits>
+#include <limits.h>
-#include <dirent.h>
#include <string.h>
#include <pthread.h>
-#include <sys/file.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -65,6 +60,8 @@
#include <osl/detail/android-bootstrap.h>
#include <android/log.h>
#include <android/asset_manager.h>
+#include <o3tl/string_view.hxx>
+#include <vector>
#endif
namespace {
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 8e079fe44e42..ce2701f8cf1a 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -17,13 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <osl/file.hxx>
#include <osl/detail/file.h>
#include <osl/diagnose.h>
-#include <osl/thread.h>
-#include <osl/signal.h>
-#include <rtl/alloc.h>
#include <rtl/string.hxx>
#include <sal/log.hxx>
@@ -36,22 +32,17 @@
#include "readwrite_helper.hxx"
#include "unixerrnostring.hxx"
-#include <sys/types.h>
#include <errno.h>
#include <dirent.h>
+#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <utime.h>
-#include <sys/file.h>
#include <sys/stat.h>
-#include <sys/mman.h>
#include <algorithm>
-#include <cassert>
-#include <cstring>
-#include <memory>
#include <new>
#ifdef ANDROID
diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx
index fe56386d8719..5c165132e9f3 100644
--- a/sal/osl/unx/file_stat.cxx
+++ b/sal/osl/unx/file_stat.cxx
@@ -19,9 +19,7 @@
#include <osl/file.h>
-#include "system.hxx"
#include <sys/stat.h>
-#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <limits.h>
@@ -31,6 +29,7 @@
#include <osl/diagnose.h>
#include <osl/thread.h>
+#include "system.hxx"
#include "file_impl.hxx"
#include "file_error_transl.hxx"
#include "file_path_helper.hxx"
diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index c69670d6373a..be98df95f14e 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -19,18 +19,13 @@
#include "file_url.hxx"
-#include "system.hxx"
-
#include <algorithm>
#include <cassert>
#include <cstring>
#include <stdexcept>
#include <string_view>
-#include <type_traits>
#include <limits.h>
#include <errno.h>
-#include <strings.h>
-#include <unistd.h>
#include <o3tl/safeint.hxx>
#include <osl/file.hxx>
@@ -46,7 +41,6 @@
#include <rtl/uri.h>
#include <rtl/uri.hxx>
#include <rtl/ustring.hxx>
-#include <rtl/ustrbuf.h>
#include <rtl/ustrbuf.hxx>
#include <rtl/textcvt.h>
#include <sal/log.hxx>
diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx
index 5e661bd656c3..e20b8a27d00e 100644
--- a/sal/osl/unx/file_volume.cxx
+++ b/sal/osl/unx/file_volume.cxx
@@ -23,7 +23,6 @@
#include <osl/diagnose.h>
#include <osl/thread.h>
-#include <rtl/alloc.h>
#include "file_error_transl.hxx"
#include "file_url.hxx"
@@ -31,11 +30,8 @@
#include <errno.h>
#include <limits.h>
-#include <stdio.h>
#include <string.h>
#include <unistd.h>
-#include <sys/wait.h>
-#include <sal/macros.h>
#ifdef HAVE_STATFS_H
#undef HAVE_STATFS_H
@@ -53,9 +49,7 @@
#define HAVE_STATFS_H
#elif defined(LINUX)
-
-#include <mntent.h>
-#include <sys/vfs.h>
+#include <sys/statfs.h>
#define HAVE_STATFS_H
#elif defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY)
diff --git a/sal/osl/unx/interlck.cxx b/sal/osl/unx/interlck.cxx
index 81404cb57a7a..8bc63211b328 100644
--- a/sal/osl/unx/interlck.cxx
+++ b/sal/osl/unx/interlck.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "system.hxx"
-
#include <config_global.h>
#include <osl/interlck.h>
diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx
index 532633f31d28..0da54f475847 100644
--- a/sal/osl/unx/module.cxx
+++ b/sal/osl/unx/module.cxx
@@ -23,14 +23,12 @@
#include <sal/types.h>
#include <osl/module.h>
#include <osl/thread.h>
-#include <osl/process.h>
#include <osl/file.h>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include <assert.h>
#include <dlfcn.h>
-#include <dirent.h>
-#include "system.hxx"
+#include <limits.h>
#include "file_url.hxx"
static bool getModulePathFromAddress(void * address, rtl_String ** path)
diff --git a/sal/osl/unx/mutex.cxx b/sal/osl/unx/mutex.cxx
index 1ca4958fd01d..e3786e43a1f4 100644
--- a/sal/osl/unx/mutex.cxx
+++ b/sal/osl/unx/mutex.cxx
@@ -23,7 +23,6 @@
#define _GNU_SOURCE 1
#endif
#endif
-#include "system.hxx"
#include "unixerrnostring.hxx"
#include <sal/log.hxx>
diff --git a/sal/osl/unx/nlsupport.cxx b/sal/osl/unx/nlsupport.cxx
index 2780a7fdd895..4cd02fe0e594 100644
--- a/sal/osl/unx/nlsupport.cxx
+++ b/sal/osl/unx/nlsupport.cxx
@@ -20,14 +20,12 @@
#include <sal/config.h>
#include <algorithm>
+#include <cassert>
#include <cstring>
#include <osl/nlsupport.h>
#include <osl/diagnose.h>
#include <osl/process.h>
-#include <rtl/string.hxx>
-#include <rtl/ustring.hxx>
-#include <sal/log.hxx>
#include "nlsupport.hxx"
@@ -45,11 +43,11 @@
#elif defined(MACOSX) || defined(IOS)
#include <osl/module.h>
#include <osl/thread.h>
+#include <rtl/ustring.hxx>
+#include <sal/log.hxx>
#include "system.hxx"
#endif
-#include <string.h>
-
namespace {
struct Pair {
diff --git a/sal/osl/unx/nlsupport.hxx b/sal/osl/unx/nlsupport.hxx
index ba5acf23c277..9eade33d02ab 100644
--- a/sal/osl/unx/nlsupport.hxx
+++ b/sal/osl/unx/nlsupport.hxx
@@ -23,6 +23,7 @@
#include <sal/config.h>
#include <rtl/locale.h>
+#include <rtl/ustring.hxx>
namespace rtl
{
diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index b4d0f09fd3d4..9aaa83bcb79e 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "system.hxx"
-
#include <o3tl/safeint.hxx>
#include <osl/pipe.h>
#include <osl/diagnose.h>
@@ -35,7 +33,7 @@
#include <cassert>
#include <cstring>
-#include <sys/file.h>
+#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx
index 4e06d6369108..d54864042465 100644
--- a/sal/osl/unx/process.cxx
+++ b/sal/osl/unx/process.cxx
@@ -21,8 +21,8 @@
#include <rtl/ustring.hxx>
#include <cassert>
-#include <dirent.h>
-#include <sys/file.h>
+#include <fcntl.h>
+#include <limits.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
@@ -57,16 +57,11 @@
#include <osl/thread.h>
#include <osl/file.h>
#include <osl/file.hxx>
-#include <osl/signal.h>
-#include <rtl/alloc.h>
#include <sal/log.hxx>
-#include <grp.h>
-
#include "createfilehandlefromfd.hxx"
#include "file_url.hxx"
#include "readwrite_helper.hxx"
-#include "sockimpl.hxx"
#include "secimpl.hxx"
#define MAX_ARGS 255
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index 576b50486119..e2d3d125b0ab 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -33,7 +33,6 @@
#include <osl/thread.h>
#include <rtl/alloc.h>
#include <rtl/ustring.hxx>
-#include <rtl/strbuf.h>
#include <sal/log.hxx>
#include "file_path_helper.hxx"
diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx
index 881e66d5ce40..1e7512a24db4 100644
--- a/sal/osl/unx/profile.cxx
+++ b/sal/osl/unx/profile.cxx
@@ -24,15 +24,12 @@
#include <osl/diagnose.h>
#include <osl/profile.h>
-#include <osl/process.h>
-#include <osl/thread.h>
-#include <rtl/alloc.h>
#include <sal/log.hxx>
-#include <dirent.h>
-#include <sys/file.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <string.h>
#include <sys/stat.h>
-#include <sys/un.h>
#include <unistd.h>
#define LINES_INI 32
diff --git a/sal/osl/unx/random.cxx b/sal/osl/unx/random.cxx
index 7c76fed9498d..e8379f8f0bf7 100644
--- a/sal/osl/unx/random.cxx
+++ b/sal/osl/unx/random.cxx
@@ -7,11 +7,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "system.hxx"
#include <oslrandom.h>
#include <assert.h>
-#include <sys/file.h>
+#include <errno.h>
+#include <fcntl.h>
#include <unistd.h>
int osl_get_system_random_data(char* buffer, size_t desired_len)
diff --git a/sal/osl/unx/readwrite_helper.cxx b/sal/osl/unx/readwrite_helper.cxx
index 48330b4bde03..f28fb16cd04f 100644
--- a/sal/osl/unx/readwrite_helper.cxx
+++ b/sal/osl/unx/readwrite_helper.cxx
@@ -12,13 +12,12 @@
#include <algorithm>
#include <cassert>
#include <cstddef>
+#include <errno.h>
#include <limits>
#include <unistd.h>
#include "readwrite_helper.hxx"
-#include "system.hxx"
-
namespace {
std::size_t cap_ssize_t(std::size_t value) {
diff --git a/sal/osl/unx/salinit.cxx b/sal/osl/unx/salinit.cxx
index c55cb2667be3..fb6922a2e36f 100644
--- a/sal/osl/unx/salinit.cxx
+++ b/sal/osl/unx/salinit.cxx
@@ -31,7 +31,6 @@
#include <config_global.h>
#include <osl/process.h>
#include <sal/main.h>
-#include <sal/types.h>
#include "saltime.hxx"
#include "soffice.hxx"
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index 9747fe92ea81..733aa0dfc6bf 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -32,20 +32,14 @@
#include <postmac.h>
#endif
-#include "system.hxx"
-
#include <o3tl/safeint.hxx>
#include <osl/security.h>
-#include <rtl/bootstrap.hxx>
+#include <rtl/string.hxx>
#include <sal/log.hxx>
#include <osl/thread.h>
#include <osl/file.h>
-#if defined LINUX || defined __sun
-#include <crypt.h>
-#endif
-
#if defined HAIKU
#include <fs_info.h>
#include <FindDirectory.h>
@@ -55,6 +49,7 @@
#ifdef ANDROID
#define getpwuid_r(uid, pwd, buf, buflen, result) (*(result) = getpwuid(uid), (*(result) ? (memcpy (buf, *(result), sizeof (struct passwd)), 0) : errno))
+#include <rtl/bootstrap.hxx>
#endif
static bool osl_psz_getHomeDir(oslSecurity Security, OString* pszDirectory);
diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx
index 8fcfbc534ec5..50c260f9d592 100644
--- a/sal/osl/unx/signal.cxx
+++ b/sal/osl/unx/signal.cxx
@@ -24,8 +24,6 @@
#include <config_features.h>
#include "soffice.hxx"
-/* system headers */
-#include "system.hxx"
#include "backtrace.h"
@@ -35,10 +33,7 @@
#include <osl/signal.h>
#include <sal/log.hxx>
#include <sal/macros.h>
-#include <rtl/bootstrap.h>
-#include <rtl/digest.h>
-#include "file_path_helper.hxx"
#define ACT_IGNORE 1
#define ACT_EXIT 2
#define ACT_SYSTEM 3
@@ -49,7 +44,7 @@
#include <valgrind/memcheck.h>
#endif
-#include <sys/wait.h>
+#include <signal.h>
#include <unistd.h>
namespace
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index 5573ca275afc..e875e415e709 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -24,8 +24,6 @@
#include "system.hxx"
#include <osl/socket.h>
-#include <osl/mutex.h>
-#include <osl/signal.h>
#include <rtl/alloc.h>
#include <rtl/byteseq.h>
@@ -39,10 +37,10 @@
#include <oslsocket.hxx>
#include <arpa/inet.h>
+#include <fcntl.h>
#include <netdb.h>
#include <netinet/tcp.h>
#include <poll.h>
-#include <sys/file.h>
#include <unistd.h>
/* defines for shutdown */
diff --git a/sal/osl/unx/system.cxx b/sal/osl/unx/system.cxx
index 19c32226df2f..f19bd7053100 100644
--- a/sal/osl/unx/system.cxx
+++ b/sal/osl/unx/system.cxx
@@ -17,17 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <unistd.h>
-#include <string.h>
-
-#include <config_features.h>
-
#include "system.hxx"
#ifdef NO_PTHREAD_RTL
#if defined(MACOSX)
+#include <config_features.h>
+
#include <premac.h>
#include <Foundation/Foundation.h>
#include <postmac.h>
diff --git a/sal/osl/unx/system.hxx b/sal/osl/unx/system.hxx
index 8601850a1309..5f5a16aa3671 100644
--- a/sal/osl/unx/system.hxx
+++ b/sal/osl/unx/system.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <errno.h>
+#include <grp.h>
/* Make sockets of type AF_UNIX use underlying FS rights */
#if defined(__sun) && !defined(_XOPEN_SOURCE)
diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx
index dbafe2fae297..85259f1667f3 100644
--- a/sal/osl/unx/tempfile.cxx
+++ b/sal/osl/unx/tempfile.cxx
@@ -17,13 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <stdio.h>
#include <stdlib.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
-#include "system.hxx"
#include <osl/file.h>
#include <osl/thread.h>
#include <rtl/ustrbuf.h>
diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx
index 804ac6ec2a1e..b17f363511c6 100644
--- a/sal/osl/unx/thread.cxx
+++ b/sal/osl/unx/thread.cxx
@@ -20,8 +20,6 @@
#include <sal/config.h>
#include <cassert>
-#include <cstddef>
-#include <limits>
#include <functional>
#include <mutex>
#include <unistd.h>
@@ -45,7 +43,6 @@
#include <osl/thread.h>
#include <osl/nlsupport.h>
#include <rtl/textenc.h>
-#include <rtl/alloc.h>
#include <sal/log.hxx>
#include <sal/macros.h>
#ifdef ANDROID
diff --git a/sal/osl/unx/time.cxx b/sal/osl/unx/time.cxx
index d6a2ca33ba6c..cf5473ff24bf 100644
--- a/sal/osl/unx/time.cxx
+++ b/sal/osl/unx/time.cxx
@@ -20,7 +20,6 @@
#include <sal/config.h>
#include "saltime.hxx"
-#include "system.hxx"
#include <osl/time.h>
#include <time.h>
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index fca0c179e9e7..033b1a435a77 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -31,9 +31,9 @@
#include <osl/thread.h>
#include <sal/log.hxx>
-#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <fcntl.h>
#include <utime.h>
#ifdef ANDROID