소스 검색

Kernel+LibC: Share definitions for sys/times.h

Andreas Kling 3 년 전
부모
커밋
35b52338bb
3개의 변경된 파일27개의 추가작업 그리고 17개의 파일을 삭제
  1. 24 0
      Kernel/API/POSIX/sys/times.h
  2. 1 7
      Kernel/UnixTypes.h
  3. 2 10
      Userland/Libraries/LibC/sys/times.h

+ 24 - 0
Kernel/API/POSIX/sys/times.h

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <Kernel/API/POSIX/sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct tms {
+    clock_t tms_utime;
+    clock_t tms_stime;
+    clock_t tms_cutime;
+    clock_t tms_cstime;
+};
+
+#ifdef __cplusplus
+}
+#endif

+ 1 - 7
Kernel/UnixTypes.h

@@ -22,6 +22,7 @@
 #include <Kernel/API/POSIX/sys/mman.h>
 #include <Kernel/API/POSIX/sys/socket.h>
 #include <Kernel/API/POSIX/sys/stat.h>
+#include <Kernel/API/POSIX/sys/times.h>
 #include <Kernel/API/POSIX/sys/un.h>
 #include <Kernel/API/POSIX/sys/utsname.h>
 #include <Kernel/API/POSIX/sys/wait.h>
@@ -38,13 +39,6 @@ TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID);
 TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID);
 TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID);
 
-struct tms {
-    clock_t tms_utime;
-    clock_t tms_stime;
-    clock_t tms_cutime;
-    clock_t tms_cstime;
-};
-
 typedef i64 off_t;
 typedef i64 time_t;
 

+ 2 - 10
Userland/Libraries/LibC/sys/times.h

@@ -1,23 +1,15 @@
 /*
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
  *
  * SPDX-License-Identifier: BSD-2-Clause
  */
 
 #pragma once
 
-#include <sys/cdefs.h>
-#include <sys/types.h>
+#include <Kernel/API/POSIX/sys/times.h>
 
 __BEGIN_DECLS
 
-struct tms {
-    clock_t tms_utime;
-    clock_t tms_stime;
-    clock_t tms_cutime;
-    clock_t tms_cstime;
-};
-
 clock_t times(struct tms*);
 
 __END_DECLS