1.1 --- a/libexec/lib/src/process.cc Tue Apr 02 23:59:13 2024 +0200
1.2 +++ b/libexec/lib/src/process.cc Sat Apr 06 21:57:01 2024 +0200
1.3 @@ -258,9 +258,7 @@
1.4 st.set_l4re_env(&_env);
1.5
1.6 /* Reserve some extra space for capabilities used by this thread.
1.7 - NOTE: Surely the capability allocator should be able to avoid conflicts,
1.8 - but concurrency issues have been observed before, leading to various
1.9 - measures in libipc. */
1.10 + NOTE: The capability allocator is probably not able to avoid conflicts. */
1.11
1.12 _env.first_free_cap += 0x20;
1.13
2.1 --- a/libfsclient/lib/src/client.cc Tue Apr 02 23:59:13 2024 +0200
2.2 +++ b/libfsclient/lib/src/client.cc Sat Apr 06 21:57:01 2024 +0200
2.3 @@ -35,11 +35,11 @@
2.4
2.5 /* Default size of pipe regions. */
2.6
2.7 -const offset_t DEFAULT_PIPE_SIZE = 4096;
2.8 +static const offset_t DEFAULT_PIPE_SIZE = 4096;
2.9
2.10 /* Size of the core member region of a directory entry structure. */
2.11
2.12 -const offset_t DIRENT_CORE_SIZE = (sizeof(struct dirent) - sizeof(((struct dirent *) 0)->d_name));
2.13 +static const offset_t DIRENT_CORE_SIZE = (sizeof(struct dirent) - sizeof(((struct dirent *) 0)->d_name));
2.14
2.15
2.16
3.1 --- a/libfsclient/lib/src/file.cc Tue Apr 02 23:59:13 2024 +0200
3.2 +++ b/libfsclient/lib/src/file.cc Sat Apr 06 21:57:01 2024 +0200
3.3 @@ -548,7 +548,10 @@
3.4
3.5 offset_t file_data_available(file_t *file)
3.6 {
3.7 - return file_populated_span(file) - file->data_current;
3.8 + if (file_populated_span(file) > file->data_current)
3.9 + return file_populated_span(file) - file->data_current;
3.10 + else
3.11 + return 0;
3.12 }
3.13
3.14 /* Return the current data offset in the region. */
4.1 --- a/libsystypes/include/systypes/stat.h Tue Apr 02 23:59:13 2024 +0200
4.2 +++ b/libsystypes/include/systypes/stat.h Sat Apr 06 21:57:01 2024 +0200
4.3 @@ -1,7 +1,7 @@
4.4 /*
4.5 * File metadata abstractions.
4.6 *
4.7 - * Copyright (C) 2019, 2022 Paul Boddie <paul@boddie.org.uk>
4.8 + * Copyright (C) 2019, 2022, 2024 Paul Boddie <paul@boddie.org.uk>
4.9 *
4.10 * This program is free software; you can redistribute it and/or
4.11 * modify it under the terms of the GNU General Public License as
4.12 @@ -48,6 +48,28 @@
4.13
4.14 } sys_stat_t;
4.15
4.16 +/* Macros to be used in different C library environments. */
4.17 +
4.18 +#define COPY_STAT(s1, s2) \
4.19 + s1->st_dev = s2->st_dev; \
4.20 + s1->st_ino = s2->st_ino; \
4.21 + s1->st_mode = s2->st_mode; \
4.22 + s1->st_nlink = s2->st_nlink; \
4.23 + s1->st_uid = s2->st_uid; \
4.24 + s1->st_gid = s2->st_gid; \
4.25 + s1->st_rdev = s2->st_rdev; \
4.26 + s1->st_size = s2->st_size; \
4.27 + s1->st_atim.tv_sec = s2->st_atim.tv_sec; \
4.28 + s1->st_atim.tv_nsec = s2->st_atim.tv_nsec; \
4.29 + s1->st_mtim.tv_sec = s2->st_mtim.tv_sec; \
4.30 + s1->st_mtim.tv_nsec = s2->st_mtim.tv_nsec; \
4.31 + s1->st_ctim.tv_sec = s2->st_ctim.tv_sec; \
4.32 + s1->st_ctim.tv_nsec = s2->st_ctim.tv_nsec; \
4.33 + s1->st_blksize = s2->st_blksize; \
4.34 + s1->st_blocks = s2->st_blocks;
4.35 +
4.36 +/* Functions to be implemented in different C library environments. */
4.37 +
4.38 void systypes_copy_from_sys_stat(struct stat *st, sys_stat_t *sst);
4.39
4.40 void systypes_copy_to_sys_stat(struct stat *st, sys_stat_t *sst);
5.1 --- a/libsystypes/lib/src/stat.c Tue Apr 02 23:59:13 2024 +0200
5.2 +++ b/libsystypes/lib/src/stat.c Sat Apr 06 21:57:01 2024 +0200
5.3 @@ -1,7 +1,7 @@
5.4 /*
5.5 * Utility functions for stat structures.
5.6 *
5.7 - * Copyright (C) 2022 Paul Boddie <paul@boddie.org.uk>
5.8 + * Copyright (C) 2022, 2024 Paul Boddie <paul@boddie.org.uk>
5.9 *
5.10 * This program is free software; you can redistribute it and/or
5.11 * modify it under the terms of the GNU General Public License as
5.12 @@ -21,32 +21,24 @@
5.13
5.14 #include "stat.h"
5.15
5.16 -#define COPY_STAT(s1, s2) \
5.17 - s1->st_dev = s2->st_dev; \
5.18 - s1->st_ino = s2->st_ino; \
5.19 - s1->st_mode = s2->st_mode; \
5.20 - s1->st_nlink = s2->st_nlink; \
5.21 - s1->st_uid = s2->st_uid; \
5.22 - s1->st_gid = s2->st_gid; \
5.23 - s1->st_rdev = s2->st_rdev; \
5.24 - s1->st_size = s2->st_size; \
5.25 - s1->st_atim.tv_sec = s2->st_atim.tv_sec; \
5.26 - s1->st_atim.tv_nsec = s2->st_atim.tv_nsec; \
5.27 - s1->st_mtim.tv_sec = s2->st_mtim.tv_sec; \
5.28 - s1->st_mtim.tv_nsec = s2->st_mtim.tv_nsec; \
5.29 - s1->st_ctim.tv_sec = s2->st_ctim.tv_sec; \
5.30 - s1->st_ctim.tv_nsec = s2->st_ctim.tv_nsec; \
5.31 - s1->st_blksize = s2->st_blksize; \
5.32 - s1->st_blocks = s2->st_blocks;
5.33 +void (*systypes_copy_from_sys_stat_override)(struct stat *, sys_stat_t *) = NULL;
5.34 +void (*systypes_copy_to_sys_stat_override)(struct stat *, sys_stat_t *) = NULL;
5.35
5.36 void systypes_copy_from_sys_stat(struct stat *st, sys_stat_t *sst)
5.37 {
5.38 - COPY_STAT(st, sst)
5.39 + if (systypes_copy_from_sys_stat_override != NULL)
5.40 + systypes_copy_from_sys_stat_override(st, sst);
5.41 + else
5.42 + COPY_STAT(st, sst)
5.43 }
5.44
5.45 void systypes_copy_to_sys_stat(struct stat *st, sys_stat_t *sst)
5.46 {
5.47 - COPY_STAT(sst, st)
5.48 + if (systypes_copy_from_sys_stat_override != NULL)
5.49 + systypes_copy_to_sys_stat_override(st, sst);
5.50 + else
5.51 + COPY_STAT(sst, st)
5.52 }
5.53
5.54 -// vim: tabstop=2 expandtab shiftwidth=2
5.55 +/* vim: tabstop=2 expandtab shiftwidth=2
5.56 +*/