Also add fstat() and lstat(). I don't #define the constants for st_mode or d_type, but I provide enough to get the block size of a file and to list the names in a directory. Some fields of struct stat get truncated, see XXX in plat/osx/include/sys/stat.h. In struct dirent, the inode field might be d_ino or d_fileno. I picked d_ino because Apple's sys/dirent.h uses d_ino (but Apple's manual pages use d_fileno).
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			448 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			448 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| include("plat/build.lua")
 | |
| 
 | |
| headermap = {}
 | |
| packagemap = {}
 | |
| 
 | |
| local function addheader(h)
 | |
| 	headermap[h] = "plat/osx/include/"..h
 | |
| 	packagemap["$(PLATIND)/osx/include/"..h] = "plat/osx/include/"..h
 | |
| end
 | |
| 
 | |
| addheader("ack/config.h")
 | |
| addheader("sys/dirent.h")
 | |
| addheader("sys/mman.h")
 | |
| addheader("sys/stat.h")
 | |
| addheader("sys/types.h")
 | |
| addheader("unistd.h")
 | |
| 
 | |
| acklibrary {
 | |
| 	name = "headers",
 | |
| 	hdrs = headermap
 | |
| }
 | |
| 
 | |
| installable {
 | |
| 	name = "pkg",
 | |
| 	map = packagemap
 | |
| }
 |