What is the output of this program no 15?

int main()
struct sockaddr_un add_server, add_client;
int fd_server, fd_client;
int len;
char ch;
fd_server = socket(AF_UNIX,SOCK_STREAM,0);
if(fd_server == -1)
add_server.sun_family = AF_UNIX;
if( bind(fd_server,(struct sockaddr*)&add_server,sizeof(add_server)) != 0)
len = sizeof(add_client);
fd_client = connect(fd_server,(struct sockaddr*)&add_client,&len);
return 0;
a) this program will print the string "google"
b) segmentation fault
c) error
d) none of the mentioned

Submitted by: Murtaza
c) error
The syntax of the connect() is wrong. connect() should be used in client program only.
[root@localhost google]# gcc -o san san.c
san.c: In function 'main':
san.c:20:46: warning: passing argument 3 of 'connect' makes integer from pointer without a cast [enabled by default]
/usr/include/sys/socket.h:129:12: note: expected 'socklen_t' but argument is of type 'int *'
[root@localhost google]#
Submitted by: Murtaza

Read Online Linux Debugging Job Interview Questions And Answers