Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build on OmniOS due to missing PATH_MAX definition #1344

Closed
1 task done
szaydel opened this issue Feb 16, 2022 · 4 comments
Closed
1 task done

Unable to build on OmniOS due to missing PATH_MAX definition #1344

szaydel opened this issue Feb 16, 2022 · 4 comments

Comments

@szaydel
Copy link
Contributor

szaydel commented Feb 16, 2022

Please acknowledge the following before creating a ticket

Description of the bug:
Observing the following when no changes are made building from master.

$ gmake
    CC cconv.o
In file included from stat.h:6:0,
                 from thread_options.h:7,
                 from cconv.c:4:
diskutil.h:52:12: error: 'PATH_MAX' undeclared here (not in a function); did you mean 'INT8_MAX'?
  char path[PATH_MAX];
            ^~~~~~~~
            INT8_MAX
gmake: *** [Makefile:505: cconv.o] Error 1

With the following change I am able to build without a problem.

$ git diff
diff --git a/diskutil.h b/diskutil.h
index 83bcbf89..0b48e3b0 100644
--- a/diskutil.h
+++ b/diskutil.h
@@ -4,6 +4,9 @@

 #include "helper_thread.h"
 #include "fio_sem.h"
+#ifdef __sun
+#include <limits.h>
+#endif

 struct disk_util_stats {
        uint64_t ios[2];

This is is likely not the most correct approach, but it works. I would not mind fixing this so that it correctly built on Omni.

Environment:

$ uname -a
SunOS omni-lab 5.11 omnios-r151040-d75907718a i86pc i386 i86pc

fio version: Latest ref on the master branch

Reproduction steps

$ ./configure && gmake
@axboe
Copy link
Owner

axboe commented Feb 16, 2022

I think we should just include it unconditionally, that should be safe. Hopefully... I'll give it a go.

axboe added a commit that referenced this issue Feb 16, 2022
On OmniOS, compilation fails because of a missing PATH_MAX definition:

$ gmake
    CC cconv.o
In file included from stat.h:6:0,
                 from thread_options.h:7,
                 from cconv.c:4:
diskutil.h:52:12: error: 'PATH_MAX' undeclared here (not in a function); did you mean 'INT8_MAX'?
  char path[PATH_MAX];
            ^~~~~~~~
            INT8_MAX
gmake: *** [Makefile:505: cconv.o] Error 1

Add limits.h to fix that.

Link: #1344
Signed-off-by: Jens Axboe <axboe@kernel.dk>
@szaydel
Copy link
Contributor Author

szaydel commented Feb 16, 2022

Yeah, it should be harmless, but I figured I would minimize the affect at least in my own testing. It seems like we are trying not to have any system level includes in this file, which was another reason for trying to limit blast radius.

@axboe
Copy link
Owner

axboe commented Feb 16, 2022

I did push a fix, so feel free to close this one provided it works for you now.

@szaydel
Copy link
Contributor Author

szaydel commented Feb 16, 2022

Yup, LGTM. Thanks a lot for getting this incorporated quickly, I appreciate it!

@szaydel szaydel closed this as completed Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants