1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
From 1d486ac55014c39f225f12bac80202197c2bf9c6 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Wed, 11 Apr 2018 23:43:19 -0500
Subject: [PATCH 3/7] pathconf: add _PC_TIMESTAMP_RESOLUTION
Right now, this is a worst-case assumption; some kernels may actually
have a value of 100000 here (100 Hz timers). This is considered the
easiest implementation.
This is required to be present in <unistd.h>.
---
include/unistd.h | 1 +
src/conf/fpathconf.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/unistd.h b/include/unistd.h
index 68686dfd..1bdd3292 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -274,6 +274,7 @@ int eaccess(const char *, int);
#define _PC_ALLOC_SIZE_MIN 18
#define _PC_SYMLINK_MAX 19
#define _PC_2_SYMLINKS 20
+#define _PC_TIMESTAMP_RESOLUTION 21
#define _SC_ARG_MAX 0
#define _SC_CHILD_MAX 1
diff --git a/src/conf/fpathconf.c b/src/conf/fpathconf.c
index 8eb037e6..1eefac18 100644
--- a/src/conf/fpathconf.c
+++ b/src/conf/fpathconf.c
@@ -25,7 +25,8 @@ long fpathconf(int fd, int name)
[_PC_REC_XFER_ALIGN] = 4096,
[_PC_ALLOC_SIZE_MIN] = 4096,
[_PC_SYMLINK_MAX] = SYMLINK_MAX,
- [_PC_2_SYMLINKS] = 1
+ [_PC_2_SYMLINKS] = 1,
+ [_PC_TIMESTAMP_RESOLUTION] = 1000000,
};
if (name >= sizeof(values)/sizeof(values[0])) {
errno = EINVAL;
--
2.15.0
|