Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Nov 15, 2022

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 2d92b09513b3c11a04541298aece35eae3dbc963:

Merge branch 'master' of https://github.com/bvanassche/fio (2022-11-07 16:20:04 -0700)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 07c8fe21021681f86fbfd3c3d63b88a5ebd4e557:

Merge branch 'master' of https://github.com/bvanassche/fio (2022-11-14 08:47:00 -0500)

----------------------------------------------------------------
Bart Van Assche (3):
configure: Fix clock_gettime() detection
configure: Fix the struct nvme_uring_cmd detection os/os.h: Improve cpus_configured()

Vincent Fu (1):
Merge branch 'master' of https://github.com/bvanassche/fio

 configure | 10 ++++++----
 os/os.h   |  4 +++-
 2 files changed, 9 insertions(+), 5 deletions(-)

---

Diff of recent changes:

configure +6 -4
index 30bf5acb..1b12d268 100755
@@ -1172,7 +1172,9 @@ cat > $TMPC << EOF
 #include <time.h>
 int main(int argc, char **argv)
 {
-  return clock_gettime(0, NULL);
+  struct timespec ts;
+
+  return clock_gettime(0, &ts);
 }
 EOF
 if compile_prog "" "" "clock_gettime"; then
@@ -1194,7 +1196,9 @@ if test "$clock_gettime" = "yes" ; then
 #include <time.h>
 int main(int argc, char **argv)
 {
-  return clock_gettime(CLOCK_MONOTONIC, NULL);
+  struct timespec ts;
+
+  return clock_gettime(CLOCK_MONOTONIC, &ts);
 }
 EOF
   if compile_prog "" "$LIBS" "clock monotonic"; then
@@ -2634,8 +2638,6 @@ cat > $TMPC << EOF
 #include <linux/nvme_ioctl.h>
 int main(void)
 {
-  struct nvme_uring_cmd *cmd;
-
   return sizeof(struct nvme_uring_cmd);
 }
 EOF
os/os.h +3 -1
index a6fde1fd..c428260c 100644
@@ -355,7 +355,9 @@ static inline unsigned long long get_fs_free_size(const char *path)
 #ifndef FIO_HAVE_CPU_CONF_SYSCONF
 static inline unsigned int cpus_configured(void)
 {
-	return sysconf(_SC_NPROCESSORS_CONF);
+	int nr_cpus = sysconf(_SC_NPROCESSORS_CONF);
+
+	return nr_cpus >= 1 ? nr_cpus : 1;
 }
 #endif