Dmitry Volyntsev
May 20, 2023 12:32AM
details: https://hg.nginx.org/njs/rev/7cd80c77433b
branches:
changeset: 2125:7cd80c77433b
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri May 19 20:22:15 2023 -0700
description:
FS: added support of OpenBSD for fs.stat() and friends.

diffstat:

auto/stat | 18 ++++++++++++++++++
external/njs_fs_module.c | 5 +++--
2 files changed, 21 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r 3ec3e7d2ce5f -r 7cd80c77433b auto/stat
--- a/auto/stat Fri May 19 20:22:14 2023 -0700
+++ b/auto/stat Fri May 19 20:22:15 2023 -0700
@@ -40,6 +40,24 @@ njs_feature_test="#include <sys/stat.h>
. auto/feature


+njs_feature="stat.__st_birthtim"
+njs_feature_name=NJS_HAVE__STAT_BIRTHTIM
+njs_feature_incs=
+njs_feature_libs=
+njs_feature_test="#include <sys/stat.h>
+
+ int main(void) {
+ struct stat st;
+
+ if (fstat(0, &st) != 0) {
+ return 1;
+ }
+
+ return (int) st.__st_birthtim.tv_sec;
+ }"
+. auto/feature
+
+
njs_feature="stat.st_atim"
njs_feature_name=NJS_HAVE_STAT_ATIM
njs_feature_incs=
diff -r 3ec3e7d2ce5f -r 7cd80c77433b external/njs_fs_module.c
--- a/external/njs_fs_module.c Fri May 19 20:22:14 2023 -0700
+++ b/external/njs_fs_module.c Fri May 19 20:22:15 2023 -0700
@@ -3399,8 +3399,6 @@ njs_fs_to_stat(njs_stat_t *dst, struct s
dst->st_mtim.tv_nsec = st->st_mtimespec.tv_nsec;
dst->st_ctim.tv_sec = st->st_ctimespec.tv_sec;
dst->st_ctim.tv_nsec = st->st_ctimespec.tv_nsec;
- dst->st_birthtim.tv_sec = st->st_birthtimespec.tv_sec;
- dst->st_birthtim.tv_nsec = st->st_birthtimespec.tv_nsec;

#elif (NJS_HAVE_STAT_ATIM)

@@ -3414,6 +3412,9 @@ njs_fs_to_stat(njs_stat_t *dst, struct s
#if (NJS_HAVE_STAT_BIRTHTIM)
dst->st_birthtim.tv_sec = st->st_birthtim.tv_sec;
dst->st_birthtim.tv_nsec = st->st_birthtim.tv_nsec;
+#elif (NJS_HAVE__STAT_BIRTHTIM)
+ dst->st_birthtim.tv_sec = st->__st_birthtim.tv_sec;
+ dst->st_birthtim.tv_nsec = st->__st_birthtim.tv_nsec;
#else
dst->st_birthtim.tv_sec = st->st_ctim.tv_sec;
dst->st_birthtim.tv_nsec = st->st_ctim.tv_nsec;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] FS: added support of OpenBSD for fs.stat() and friends.

Dmitry Volyntsev 273 May 20, 2023 12:32AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 202
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready