forked from Bananymous/banan-os
				
			LibC: implement close
This commit is contained in:
		
							parent
							
								
									aa86125f2b
								
							
						
					
					
						commit
						68ec443e07
					
				| 
						 | 
				
			
			@ -52,7 +52,7 @@ char* ctermid(char* buffer)
 | 
			
		|||
 | 
			
		||||
int fclose(FILE* file)
 | 
			
		||||
{
 | 
			
		||||
	if (syscall(SYS_CLOSE, file->fd) < 0)
 | 
			
		||||
	if (close(file->fd) == -1)
 | 
			
		||||
		return EOF;
 | 
			
		||||
	file->fd = -1;
 | 
			
		||||
	return 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -187,6 +187,11 @@ long syscall(long syscall, ...)
 | 
			
		|||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int close(int fd)
 | 
			
		||||
{
 | 
			
		||||
	return syscall(SYS_CLOSE, fd);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int execl(const char* pathname, const char* arg0, ...)
 | 
			
		||||
{
 | 
			
		||||
	if (arg0 == nullptr)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue