mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:42:45 +00:00 
			
		
		
		
	Kernel+LibC: Share definitions for sys/statvfs.h
This commit is contained in:
		
							parent
							
								
									dfd78b75d8
								
							
						
					
					
						commit
						e1273a8ff7
					
				
					 3 changed files with 39 additions and 41 deletions
				
			
		
							
								
								
									
										36
									
								
								Kernel/API/POSIX/sys/statvfs.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								Kernel/API/POSIX/sys/statvfs.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,36 @@ | ||||||
|  | /*
 | ||||||
|  |  * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> | ||||||
|  |  * | ||||||
|  |  * SPDX-License-Identifier: BSD-2-Clause | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | #pragma once | ||||||
|  | 
 | ||||||
|  | #include <Kernel/API/POSIX/sys/types.h> | ||||||
|  | 
 | ||||||
|  | #ifdef __cplusplus | ||||||
|  | extern "C" { | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|  | #define ST_RDONLY 0x1 | ||||||
|  | #define ST_NOSUID 0x2 | ||||||
|  | 
 | ||||||
|  | struct statvfs { | ||||||
|  |     unsigned long f_bsize; | ||||||
|  |     unsigned long f_frsize; | ||||||
|  |     fsblkcnt_t f_blocks; | ||||||
|  |     fsblkcnt_t f_bfree; | ||||||
|  |     fsblkcnt_t f_bavail; | ||||||
|  | 
 | ||||||
|  |     fsfilcnt_t f_files; | ||||||
|  |     fsfilcnt_t f_ffree; | ||||||
|  |     fsfilcnt_t f_favail; | ||||||
|  | 
 | ||||||
|  |     unsigned long f_fsid; | ||||||
|  |     unsigned long f_flag; | ||||||
|  |     unsigned long f_namemax; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | #ifdef __cplusplus | ||||||
|  | } | ||||||
|  | #endif | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
| #include <Kernel/API/POSIX/sys/ptrace.h> | #include <Kernel/API/POSIX/sys/ptrace.h> | ||||||
| #include <Kernel/API/POSIX/sys/socket.h> | #include <Kernel/API/POSIX/sys/socket.h> | ||||||
| #include <Kernel/API/POSIX/sys/stat.h> | #include <Kernel/API/POSIX/sys/stat.h> | ||||||
|  | #include <Kernel/API/POSIX/sys/statvfs.h> | ||||||
| #include <Kernel/API/POSIX/sys/time.h> | #include <Kernel/API/POSIX/sys/time.h> | ||||||
| #include <Kernel/API/POSIX/sys/times.h> | #include <Kernel/API/POSIX/sys/times.h> | ||||||
| #include <Kernel/API/POSIX/sys/uio.h> | #include <Kernel/API/POSIX/sys/uio.h> | ||||||
|  | @ -48,22 +49,3 @@ typedef u16 __u16; | ||||||
| typedef u8 __u8; | typedef u8 __u8; | ||||||
| typedef int __s32; | typedef int __s32; | ||||||
| typedef short __s16; | typedef short __s16; | ||||||
| 
 |  | ||||||
| #define ST_RDONLY 0x1 |  | ||||||
| #define ST_NOSUID 0x2 |  | ||||||
| 
 |  | ||||||
| struct statvfs { |  | ||||||
|     unsigned long f_bsize; |  | ||||||
|     unsigned long f_frsize; |  | ||||||
|     fsblkcnt_t f_blocks; |  | ||||||
|     fsblkcnt_t f_bfree; |  | ||||||
|     fsblkcnt_t f_bavail; |  | ||||||
| 
 |  | ||||||
|     fsfilcnt_t f_files; |  | ||||||
|     fsfilcnt_t f_ffree; |  | ||||||
|     fsfilcnt_t f_favail; |  | ||||||
| 
 |  | ||||||
|     unsigned long f_fsid; |  | ||||||
|     unsigned long f_flag; |  | ||||||
|     unsigned long f_namemax; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
|  | @ -6,31 +6,11 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
| #include <sys/cdefs.h> | #include <Kernel/API/POSIX/sys/statvfs.h> | ||||||
| #include <sys/types.h> |  | ||||||
| 
 | 
 | ||||||
| __BEGIN_DECLS | __BEGIN_DECLS | ||||||
| 
 | 
 | ||||||
| #define ST_RDONLY 0x1 | int statvfs(char const* path, struct statvfs* buf); | ||||||
| #define ST_NOSUID 0x2 |  | ||||||
| 
 |  | ||||||
| struct statvfs { |  | ||||||
|     unsigned long f_bsize; |  | ||||||
|     unsigned long f_frsize; |  | ||||||
|     fsblkcnt_t f_blocks; |  | ||||||
|     fsblkcnt_t f_bfree; |  | ||||||
|     fsblkcnt_t f_bavail; |  | ||||||
| 
 |  | ||||||
|     fsfilcnt_t f_files; |  | ||||||
|     fsfilcnt_t f_ffree; |  | ||||||
|     fsfilcnt_t f_favail; |  | ||||||
| 
 |  | ||||||
|     unsigned long f_fsid; |  | ||||||
|     unsigned long f_flag; |  | ||||||
|     unsigned long f_namemax; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| int statvfs(const char* path, struct statvfs* buf); |  | ||||||
| int fstatvfs(int fd, struct statvfs* buf); | int fstatvfs(int fd, struct statvfs* buf); | ||||||
| 
 | 
 | ||||||
| __END_DECLS | __END_DECLS | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling