On Thu, 25 May 2023 16:13:49 GMT, JoKern65 <d...@openjdk.org> wrote: >> test/jdk/java/io/File/libGetXSpace.c line 128: >> >>> 126: #else >>> 127: struct statfs buf; >>> 128: int result = statfs((char*)chars, &buf); >> >> Is this working around a bug in IBM's declaration? >> >> Also, pre-existing, the cast seems really suspicious. The type of `chars` >> is `jchar*`, which is a >> sequence of 16bit characters. Does this actually work? If so, how? > > This is IBMs declaration of statfs > `extern int statfs(char *, struct statfs *);` > So the compiler will not accept a `const char*` > Indeed I do not know if this ever worked, but my change makes it not worse.
Here is the documentation of statfs on AIX https://www.ibm.com/docs/en/aix/7.2?topic=s-statfs-fstatfs-statfs64-fstatfs64-ustat-subroutine (showing the IBM declaration Joachim told us) . ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14146#discussion_r1206326207