5
5
#include <errno.h>
6
6
#include <limits.h>
7
7
#include <linux/types.h>
8
+ #include <inttypes.h>
8
9
#include <stdio.h>
9
10
10
11
#include "../../tools/testing/selftests/pidfd/pidfd.h"
@@ -86,8 +87,8 @@ int main(int argc, char *argv[])
86
87
if (ret < 0 )
87
88
die_errno ("ioctl(NS_GET_MNTNS_ID) failed" );
88
89
89
- printf ("Listing %u mounts for mount namespace %llu \n" ,
90
- info .nr_mounts , info .mnt_ns_id );
90
+ printf ("Listing %u mounts for mount namespace %" PRIu64 " \n" ,
91
+ info .nr_mounts , ( uint64_t ) info .mnt_ns_id );
91
92
for (;;) {
92
93
ssize_t nr_mounts ;
93
94
next :
@@ -97,8 +98,8 @@ int main(int argc, char *argv[])
97
98
if (nr_mounts <= 0 ) {
98
99
int fd_mntns_next ;
99
100
100
- printf ("Finished listing %u mounts for mount namespace %llu \n\n" ,
101
- info .nr_mounts , info .mnt_ns_id );
101
+ printf ("Finished listing %u mounts for mount namespace %" PRIu64 " \n\n" ,
102
+ info .nr_mounts , ( uint64_t ) info .mnt_ns_id );
102
103
fd_mntns_next = ioctl (fd_mntns , NS_MNT_GET_NEXT , & info );
103
104
if (fd_mntns_next < 0 ) {
104
105
if (errno == ENOENT ) {
@@ -110,8 +111,8 @@ int main(int argc, char *argv[])
110
111
close (fd_mntns );
111
112
fd_mntns = fd_mntns_next ;
112
113
last_mnt_id = 0 ;
113
- printf ("Listing %u mounts for mount namespace %llu \n" ,
114
- info .nr_mounts , info .mnt_ns_id );
114
+ printf ("Listing %u mounts for mount namespace %" PRIu64 " \n" ,
115
+ info .nr_mounts , ( uint64_t ) info .mnt_ns_id );
115
116
goto next ;
116
117
}
117
118
@@ -129,14 +130,14 @@ int main(int argc, char *argv[])
129
130
STATMOUNT_MNT_OPTS |
130
131
STATMOUNT_FS_TYPE , 0 );
131
132
if (!stmnt ) {
132
- printf ("Failed to statmount(%llu ) in mount namespace(%llu )\n" ,
133
- last_mnt_id , info .mnt_ns_id );
133
+ printf ("Failed to statmount(%" PRIu64 " ) in mount namespace(%" PRIu64 " )\n" ,
134
+ ( uint64_t ) last_mnt_id , ( uint64_t ) info .mnt_ns_id );
134
135
continue ;
135
136
}
136
137
137
- printf ("mnt_id:\t\t%llu \nmnt_parent_id:\t%llu \nfs_type:\t%s\nmnt_root:\t%s\nmnt_point:\t%s\nmnt_opts:\t%s\n\n" ,
138
- stmnt -> mnt_id ,
139
- stmnt -> mnt_parent_id ,
138
+ printf ("mnt_id:\t\t%" PRIu64 " \nmnt_parent_id:\t%" PRIu64 " \nfs_type:\t%s\nmnt_root:\t%s\nmnt_point:\t%s\nmnt_opts:\t%s\n\n" ,
139
+ ( uint64_t ) stmnt -> mnt_id ,
140
+ ( uint64_t ) stmnt -> mnt_parent_id ,
140
141
stmnt -> str + stmnt -> fs_type ,
141
142
stmnt -> str + stmnt -> mnt_root ,
142
143
stmnt -> str + stmnt -> mnt_point ,
0 commit comments