I would like to used options available in the GNU version of the 'stat' command. I couldn't find it in the Ports. I have little C programming ability. I'm not requesting a lot of time, so if this issue doesn't have an easy answer please pass.
I get better results (fewer errors) using g++ rather than gcc. The sys/sysmacros.h and sys/vfs.h were found by including /usr/src/sys/cddl/compat/opensolaris which also has include/stdlib.h [I still the the malloc.h error when /usr/src/sys/cddl/compat/opensolaris/include/stdlib.h is removed.]
The errors to me originate from this statement at line 54.
void print_human_fstype(struct statfs *statfsbuf)
I get better results (fewer errors) using g++ rather than gcc. The sys/sysmacros.h and sys/vfs.h were found by including /usr/src/sys/cddl/compat/opensolaris which also has include/stdlib.h [I still the the malloc.h error when /usr/src/sys/cddl/compat/opensolaris/include/stdlib.h is removed.]
The errors to me originate from this statement at line 54.
void print_human_fstype(struct statfs *statfsbuf)
Code:
[root@ /usr/home/scc/Desktop/Downloads/stat-3.3]# make stat
g++ -O2 -g -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/src/sys/cddl/compat/opensolaris -o stat stat.c
In file included from stat.c:10:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by <stdlib.h>"
stat.c: In function 'void print_human_fstype(statfs*)':
stat.c:58: error: invalid use of incomplete type 'struct statfs'
stat.c:54: error: forward declaration of 'struct statfs'
stat.c:231: error: 'malloc' was not declared in this scope
stat.c:238: error: invalid use of incomplete type 'struct statfs'
stat.c:54: error: forward declaration of 'struct statfs'
stat.c: At global scope:
stat.c:242: error: expected constructor, destructor, or type conversion before '(' token
stat.c:243: error: expected constructor, destructor, or type conversion before '(' token
stat.c:244: error: expected declaration before '}' token
*** Error code 1