Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Linux OS Interviews:Awk ProgrammingBash Arithmetic ExpressionsDevice DriversGCC CompilerLinux AdministratorLinux CommandsLinux DebuggingLinux EnvironmentLinux GeneralLinux IPCLinux MakefileLinux OSLinux OS EditorsLinux OS ManagementLinux OS ShellLinux Proc FilesystemLinux Search PatternLinux Shared & Static LibrariesLinux Socket ProgrammingLinux Startup and ShutdownLinux SysfsLinux SystemsLinux ThreadsLinux UbuntuSignal HandlingSystem Calls
Copyright © 2018. All Rights Reserved
Linux Debugging Interview Question:
By this program the soket "san_sock" will create
#include<stdio.h>
#include<sys/types.h>
#include<sys/un.h>
#include<sys/socket.h>
int main()
{
struct sockaddr_un add_server;
int fd_server;
fd_server = socket(AF_UNIX,SOCK_STREAM,0);
if(fd_server == -1)
perror("socket");
add_server.sun_family = AF_UNIX;
strcpy(add_server.sun_path,"san_sock");
if( bind(fd_server,(struct sockaddr*)&add_server,sizeof(add_server)) != 0)
perror("bind");
return 0;
}
a) in the /tmp directory
b) in the /usr directory
c) in the present working directory
d) none of the mentioned
Submitted by: Murtazac) in the present working directory
Output:
[root@localhost google]# ls
san.c
[root@localhost google]# gcc -o san san.c
[root@localhost google]# ./san
[root@localhost google]# ls
san san.c san_sock
[root@localhost google]#
Submitted by: Murtaza
Output:
[root@localhost google]# ls
san.c
[root@localhost google]# gcc -o san san.c
[root@localhost google]# ./san
[root@localhost google]# ls
san san.c san_sock
[root@localhost google]#
Submitted by: Murtaza
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.