mirror of
				https://github.com/facebook/zstd.git
				synced 2025-11-04 00:02:59 -05:00 
			
		
		
		
	Somewhat surprisingly, calling `fchmod()` is non-trivially faster than calling `chmod()`, and so on. This commit introduces alternate variants to some common file util functions that take an optional fd. If present, they call the `f`-variant of the underlying function. Otherwise, they fall back to the regular filename-taking version of the function.
		
			
				
	
	
		
			21 lines
		
	
	
		
			625 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			625 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
Trace:FileStat: > UTIL_isConsole(0)
 | 
						|
Trace:FileStat: < 0
 | 
						|
Trace:FileStat: > UTIL_isConsole(2)
 | 
						|
Trace:FileStat: < 0
 | 
						|
Trace:FileStat: > UTIL_isDirectory(/*stdin*\)
 | 
						|
Trace:FileStat:  > UTIL_stat(-1, /*stdin*\)
 | 
						|
Trace:FileStat:  < 0
 | 
						|
Trace:FileStat: < 0
 | 
						|
Trace:FileStat: > UTIL_isSameFile(/*stdin*\, file)
 | 
						|
Trace:FileStat:  > UTIL_stat(-1, /*stdin*\)
 | 
						|
Trace:FileStat:  < 0
 | 
						|
Trace:FileStat: < 0
 | 
						|
Trace:FileStat: > UTIL_isRegularFile(file)
 | 
						|
Trace:FileStat:  > UTIL_stat(-1, file)
 | 
						|
Trace:FileStat:  < 0
 | 
						|
Trace:FileStat: < 0
 | 
						|
Trace:FileStat: > UTIL_isRegularFile(file)
 | 
						|
Trace:FileStat:  > UTIL_stat(-1, file)
 | 
						|
Trace:FileStat:  < 1
 | 
						|
Trace:FileStat: < 1
 |