 98af1ee195
			
		
	
	
		98af1ee195
		
	
	
	
	
		
			
			This patch add a few weak_alias forgotten, so that non-internal symbols are defined to be used from application. Modifying only the minix-specific part, this patch needs no update to minix-port.patch.
		
			
				
	
	
		
			28 lines
		
	
	
		
			550 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			550 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*	getdomainname()					Author: Kees J. Bot
 | |
|  *								2 Dec 1994
 | |
|  */
 | |
| #define nil 0
 | |
| #include "namespace.h"
 | |
| #include <sys/types.h>
 | |
| #include <unistd.h>
 | |
| #include <string.h>
 | |
| 
 | |
| #ifdef __weak_alias
 | |
| __weak_alias(getdomainname, _getdomainname)
 | |
| #endif
 | |
| 
 | |
| int getdomainname(char *domain, size_t size)
 | |
| {
 | |
| 	char nodename[256];
 | |
| 	char *dot;
 | |
| 
 | |
| 	if (gethostname(nodename, sizeof(nodename)) < 0)
 | |
| 		return -1;
 | |
| 	nodename[sizeof(nodename)-1]= 0;
 | |
| 	if ((dot= strchr(nodename, '.')) == nil) dot= ".";
 | |
| 
 | |
| 	strncpy(domain, dot+1, size);
 | |
| 	if (size > 0) domain[size-1]= 0;
 | |
| 	return 0;
 | |
| }
 |