UNIT I INTRODUCTION TO UNIX & FILE SYSTEM

Similar documents
Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions

read(2) There can be several cases where read returns less than the number of bytes requested:

Preview. Review. System Data Files (Password File) System Data Files (Password File) System Data Files (Password File)

File I/0. Advanced Programming in the UNIX Environment

CS2028 -UNIX INTERNALS

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Files and Directories

MC1751 UNIX and Network programming. Short questions and answers

CSC 271 Software I: Utilities and Internals

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / ODD SEMESTER

SHRI ANGALAMMAN COLLEGE OF ENGINEERING AND TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo

Chp1 Introduction. Introduction. Objective. Logging In. Shell. Briefly describe services provided by various versions of the UNIX operating system.

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo

File and Directories. Advanced Programming in the UNIX Environment

Chapter 4 - Files and Directories. Information about files and directories Management of files and directories

File. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access

File Systems Overview. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University

Outline. File Systems. File System Structure. CSCI 4061 Introduction to Operating Systems

Logical disks. Bach 2.2.1

Systems Programming. 08. Standard I/O Library. Alexander Holupirek

INTERNAL REPRESENTATION OF FILES:

FILE SYSTEMS. Jo, Heeseung

PROCESS CONTROL: PROCESS CREATION: UNIT-VI PROCESS CONTROL III-II R

CMPS 105 Systems Programming. Prof. Darrell Long E2.371

Linux Operating System

ADVANCED OPERATING SYSTEMS

Operating System Labs. Yuanbin Wu

PROCESS STATES AND TRANSITIONS:

Lecture 23: System-Level I/O

System Programming. Introduction to Unix

System Calls. Library Functions Vs. System Calls. Library Functions Vs. System Calls

Department of Computer Science and Technology, UTU 2014

File System User API

OS COMPONENTS OVERVIEW OF UNIX FILE I/O. CS124 Operating Systems Fall , Lecture 2

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.

File Systems. What do we need to know?

CSE 333 SECTION 3. POSIX I/O Functions

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals

COMP 2355 Introduction to Systems Programming

CS , Spring Sample Exam 3

UNIX Kernel. UNIX History

CptS 360 (System Programming) Unit 6: Files and Directories

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

Standard I/O in C, Computer System and programming in C

INTRODUCTION TO THE UNIX FILE SYSTEM 1)

Fall 2017 :: CSE 306. File Systems Basics. Nima Honarmand

Advanced Programming in the UNIX Environment W. Richard Stevens

Introduction. CS3026 Operating Systems Lecture 01

Thesis, antithesis, synthesis

Processes. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

CSci 4061 Introduction to Operating Systems. File Systems: Basics

This document gives a general overview of the work done by an operating system and gives specific examples from UNIX.

Operating System Labs. Yuanbin Wu

CSC209 Review. Yeah! We made it!

ADVANCED OPERATING SYSTEMS

CS2506 Quick Revision

CSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19

Lecture files in /home/hwang/cs375/lecture05 on csserver.

Operating System Review

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System

File Management 1/34

(MCQZ-CS604 Operating Systems)

The Operating System. Chapter 6

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

UNIT III- INTER PROCESS COMMUNICATIONS Part A

Design Overview of the FreeBSD Kernel CIS 657

Design Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent?

mywbut.com UNIX Operating System

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

The UtePC/Yalnix Memory System

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs).

we are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O

SMD149 - Operating Systems - File systems

Typical File Extensions File Structure

Chapter 13: I/O Systems

Files and Directories Filesystems from a user s perspective

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line

UNIX System Calls. Sys Calls versus Library Func

CS 3733 Operating Systems

Unix File and I/O. Outline. Storing Information. File Systems. (USP Chapters 4 and 5) Instructor: Dr. Tongping Liu

structs as arguments

Pipes and FIFOs. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Files. Eric McCreath

UNIT I Linux Utilities

Files and Directories

Contents. Error Message Descriptions... 7

ADVANCED I/O. ISA 563: Fundamentals of Systems Programming

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

Layers in a UNIX System. Create a new process. Processes in UNIX. fildescriptors streams pipe(2) labinstructions

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University

we are here I/O & Storage Layers Recall: C Low level I/O Recall: C Low Level Operations CS162 Operating Systems and Systems Programming Lecture 18

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

Kernel Services CIS 657

Asynchronous Events on Linux

CSE 333 SECTION 3. POSIX I/O Functions

File I/O - Filesystems from a user s perspective

Transcription:

INTRODUCTION TO UNIX & FILE SYSTEM Part A 1. What is UNIX? UNIX(Uniplexed Information Computing System) it is an operating system was developed in Early 1970 at Bell Labs. It was initially a character based operating system that provided functionality for writing high level C programming. 2. What are the central concepts of UNIX system? The entities files and processes are referred as central concepts of UNIX. 3. What are the reasons for popularity of UNIX operating system? The system is written in high level language, make it easy to read, understand, change, and move to other machines. It has a simple user interface that has the power to provide the services that users want. It provides primitives that permit complex programs to be built from simpler programs. It uses a hierarchical file system, consistent format for files, byte stream, making application programs easier to write. It provide simple and consistent interface to peripheral devices. It is a multi user multi process system, it hides the machine architecture from user. 4. Define path name and component. A path name is a sequence of component names separated by slash characters; a component is a sequence of characters that designates a file name that is uniquely contained in the previous component. 5. What are the different types of commands supported by shell? A command can be an executable file that contains object code produced by compilation of source code. A command can be executable file that contains a sequence of shell command lines. A command can be an internal shell command CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 1

6. What is the purpose of system calls? It instructs the kernel to do various operations for the calling program and exchange data between the kernel and the program. 7. Write down the characteristics of UNIX file system? A hierarchical structure. Consistent treatment of file data. The ability to create and delete files. Dynamic growth of files. The protection of file data. The treatment of peripheral devices as files 8. What is Kernel? The Kernel is the core or base of the Operating System. It contains a number of modules that manage hardware dependent functions. The users do not have direct access to the Kernel. They can access the Kernel only through application programs and other utility programs. 9. What is Shell and it functions? Shell is the utility layer of the operating system. It serves the following functions. It provides a user interface for interaction with the user. It is a command interpreter that interprets commands and gets appropriate utility to do the job requested. 10. Define shell programming. It a command interpreter program that users typically execute after logging into system. The shell interprets the first word of command line as a command name. For many commands the shell forks and the child process execs a command associated with the name. 11. What are the services provided by the kernel? Controlling the execution of processes by allowing their creation, termination or suspension and communication. Scheduling processes for execution on the CPU. Allocating main memory for an executing process. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 2

Allocating secondary memory for efficient storage and retrieval of user data. Allowing processes controlled access to peripheral devices. 12. What is the purpose of memory management? Memory management module controls the allocation of memory. If at any time the system does not have enough memory for all processes the kernel moves them between main memory and secondary memory so that all processes get a fair chance to execute. 13. What is the job done by scheduler? The scheduler module allocates the CPU to process. It schedules them to run in turn until they voluntarily relinquish the CPU while awaiting a resource until the kernel preempts them when their recent run time exceeds a time quantum. The scheduler then chooses a highest priority eligible process to run. 14. What do you mean by swapping? UNIX system transferred entire processes between primary memory and swap device, but did not transfer parts of a process independently, except for a shared text. Such a memory management policy is called swapping 15. List down the types of file Regular file, Directory file, FIFO files, Character special file, Block special file, socket file, symbolic file. 16. What is the difference between user mode and kernel mode? Processes in user mode can access their own instructions and data but not kernel instructions and data. Processes in kernel mode can access kernel and user addresses. Some machine instructions are only privileged to kernel mode. 17. Define interrupts. Interrupts are caused by events that are external to process. Interrupts are considered to happen between the execution of two instructions, and the system continues with the next instruction after servicing the interrupt. 18. Define exception. Exception refers to unexpected events caused by a process such as addressing illegal memory, executing privileged instructions, dividing by zero and so on. Exception happen in the middle of the execution of an instruction and the system attempts to restart the instruction after handling the exception. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 3

19. What are the different levels of operation in UNIX kernel? User Level: The user programs and the libraries are available here. Kernel level: This is the heart of UNIX operating system. All the operations related to file system, process control sub system, hardware control, and device drivers are available in this level. Hardware level: The physical components of the system are available here. 20. What is the purpose of file sub system? The file sub system accesses file data using a buffering mechanism that regulates data flow between the kernel and secondary storage device. 21. Write down the purpose of buffering mechanism? Buffering mechanism interacts with block I/O device drivers to initiate data transfer to and from the kernel. What is the job done by device drivers and block I/O devices? Device drivers are the kernel modules that control the operation of peripheral devices. Block I/O devices are random access storage devices 22. What is the purpose of process control subsystem? The process control subsystem is responsible for process synchronization, inter process communications, memory management and process scheduling. The file subsystem and process control subsystem interact when loading a file into memory for execution. The process control subsystem reads executable files into memory before executing them. 23. What are the data structures used for file processing? File table: It is a global data structure User file descriptor table: It is allocated per process When a process opens or creats a file the kernel allocates an entry from each table corresponds to the file inode. Inode: Internal representation of file is given by an inode, which contains a description of the disk layout of the file data and other information related to permission, access time, owner etc. 24. Write about file system layout Or Define the components of file system. Boot block : This occupies the beginning of a file system, typically first sector, and may contain the bootstrap code CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 4

Super block: describes the state of the file system. Inode list : A list of inodes that follows the super block in the file system. Data blocks: Contain file data and administrative data. 25. Describe the contents in buffer cache. The buffer consists of two parts: a memory array that contains data from the disk and a buffer header that identifies the buffer. The data in buffer corresponds to the data in a logical disk block and kernel identifies the buffer contents by examining identifier fields in the buffer header. 26. What is the information available in buffer header? The buffer header contains a device number field and block number fields that specify the file system and block number of the data on disk and uniquely identify the buffer. It also contains a pointer to a data array, status field. 27. How will you identify the status of the buffer? The buffer is currently locked. The buffer contains valid data. The kernel must write buffer contents to disk before reassigning the buffer The kernel is currently reading or writing the contents of the buffer to disk. A process is currently waiting for the buffer to become free. 28. What are the different scenarios to allocate a buffer for a disk block? The kernel finds the block on its hash queue and its buffer cache. The kernel cannot find the block o the hash queue, so it allocates a buffer from the free list. The kernel cannot find the block o the hash queue and in attempting to allocate buffer from the free list, find a buffer on a free list that has been marked delayed write. The kernel must write the delayed write buffer to disk and allocate another buffer. The kernel cannot find the block o the hash queue, and the free list of buffers is empty. The kernel finds the block on the hash queue but its buffer is currently busy. 29. What are the operations during interrupt handling? The kernel handles the interrupt with the following sequence of operations It saves the current register context and creates a new context layer. It determine the source of interrupt, type of interrupt and unit number CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 5

Kernel invoke the interrupt handler Restore its previous context layer 30. What is the information available in inode? A descriptor of the disk layout of the file data and other information such as the file owner, file access permissions and access times. 31. Define the components of file system. Boot block: This block occupies the beginning of the file system, typically the first sector, and may contain the bootstrap code. Super block: describes the state of file system- how large it is, how many files it can store, where to find free space on the file system and other information. Inode list: List of inodes. Data block: This block contains file data and administrative data. 32. What do you mean by stream? A stream is a full duplex connection between a process and a device driver. It consists of a set of linearly linked queue pairs, one member of each pair for input and other for output. 33. Define directory and filename A directory is a file that contains directory entries. The directory entry containing a file name along with structure of information describing the attributes of the file. The names in a directory are called filename. The only two characters that cannot appear in a file name are / and null character. 34. Define file descriptor File descriptors are nonnegative integers that the kernel uses to identify the file being accessed by a particular process. Whenever the kernel opens an existing file or creates a new file it returns the file descriptor. 35. What are the two different time values supported by UNIX? Calendar time: This value counts the number of seconds which is 00 : 00 : 00 January 1, 1970, coordinated universal time. The data type time_t hold this time values. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 6

Process time: It is also called CPU time and measures the central processor resources used by process. Process time is measured inc clock ticks. The data type clock_t hold these time values. 36. Define user CPU time, system CPU time. The time attributed to user instructions are referred as user CPU time. The time attributed to kernel, when it executes an behalf of the process is called system CPU time. 37. What are the kernel s data structures are used for open files? Process table entry File table entry I-node structure 38. What are the important unbuffered I/O functions? Open Read Write Seek Close 39. What are the three default file descriptors used by shell when a new program is run? Standard input - 0 Standard output - 1 Standard error - 2 40. Write about close function? Close function is used to close the open files. And also it releases any record locks that the process may have on the file. Syntax: int close(int filedes); 41. Explain about current file offset? It is a non-negative integer that is associated with every open file. It measures the number of bytes from the beginning of the file. This offset is initialized to 0 when a file is opened unless the 0-Append option is specified. 42. What do you mean by access permissions? CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 7

Access permissions are set of bits associated with each file. Access permissions can be set independently to control read, write, and execute permission for three classes of users: the file owner, a file group and every one else. 43. What is the purpose of lseek function? lseek function is used for setting the current file offset of a open file. current file offset measures the number of bytes from the beginning of the file. 44. Explain the three data structures used in file starting by the kernel? Process table File table V-node structure 45. Define atomic operation? Atomic operation refers to an operation that is composed to multiple steps. If the operation is performed atomically, either all the steps are performed, or none is performed. 46. What is the use of dup and dup2 functions? Dup and dup2 functions are used to duplicate an existing file descriptor. So that, duplicated file descriptor and the original file descriptor both are pointing to the same file table entry of the open file and their share the same file status flags(read, write, etc ) and current file offset. 47. Mention the different types of files available in Unix system? Regular file Directory file Character special file FIFO Symbolic link Block special file Socket 48. What are the macros available for identifying the file type? S_ISREG() for regular file S_ISDIR() for directory file CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 8

S_ISCHR() for character special file S_ISBLK() for block special file. S_ISFIFO() For FIFO file S_ISLNK() for symbolic link S_ISOCK() for socket file The argument to these macros is the st_mode member from the stat structure. 49. Define directory file? A file that contains the names of other files and pointers to information on these files. 50. Define sticky bit The bit S_ISVTX is known as sticky bit. If this bit is set for an executable program file, then the first time the program was executed a copy of the programmer s text was saved in the swap area when the process terminated. The advantage of using this is the program is loaded into memory faster the next time. 51. How will you retrieve the file status? The file status information are retrieved by using the functions stat, fstat, lstat. The stat function returns a structure of information about the named file. The fstat function obtains information about the file that is already open. The lstat function similar to stat but when the named file is a symbolic link. 52. What are the two ways to truncate a file? To empty a file, use O-TRUNC flag to open function. Two special functions to truncate a file int truncate(const char *pathname, off-t length); int ftruncate(int filedes, off-t length); 53. Write a note on rmdir function. To delete an empty directory, we can use rmdir function Syntax: int rmdir(const char *pathname); If the link count of the directory becomes 0 with this call, and no other process has the directory open, then the space occupied by the directory is freed. 54. Define sticky bit CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 9

The bit S_ISVTX is known as sticky bit. If this bit is set for an executable program file, then the first time the program was executed a copy of the programmer s text was saved in the swap area when the process terminated. The advantage of using this is the program is loaded into memory faster the next time. 55. Define symbolic link. A symbolic link is an indirect pointer to a file unlike the hard links. There are no file system limitations on a symbolic link and what it points to and any one can create a symbolic link to a read directory. Symbolic links are typically used to move a file or an entire directory hierarchy to some other location on a system. 56. What are the different time fields maintained for each file? Last access time of file data. Last modification time of file data. Last change time of i_node status 57. Define the purpose and format of utime function The access time and modification time of a file can be changed with the utime function. The general format is # include <sys/types.h> # include <utime.h> int utime (const char * pathname, const struct utimbuf *times); Returns 0 if OK 1 on Error 58. What are the directory routines available in POSIX.1? # include <sys/types.h> #include <dirent.h> DIR *opendir ( const char *pathname)l Returns pointer if OK NULL on error struct dirent *readdir(dir *dp); Returns pointer if OK, Null at end of directory or error void rewinddir(dir *dp); int closedir(dir *dp); Returs 0 if OK 1 on error 59. What is the major goal of buffering? CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 10

To use the minimum number of read and write calls. It tries to do its buffering automatically for each I/O stream 60. What are the different types of buffering is supported by UNIX? Fully buffered : In this case the actual I/ O takes place when the standard I/ O buffer is filled Line buffered: In this case the standard I/O library performs I/o when a new line character is encountered on input or output. Un-buffered: The standard I/O library does not buffer the characters. 61. Explain about fully buffered? Actual input/output takes place when the standard input/output buffer is filled. 62. Describe Line buffered? Actual input/output when a new line character is encountered on input or output. 63. When fdopen is used? fopen cannot be used to open pipes and network communication channels. So, we use special type of functions to create pipes and communication channels. These functions return file descriptors. Using fdopen, we can open special types of files by associating file descriptors with standard I/O stream. 64. Write the syntax of a function to close a stream? int fclose(file *fp); Any buffered O/P data is flushed before the file is closed. Any I/P data that may be buffered is discarded. 65. What are the functions available to write a line at a time? int fputs(const char *str, FILE *fp); int puts(const char *str); fputs writes the null terminated string to the specified stream. puts writes the null terminated string to the standard output. 66. What are the options available to determine the group ID of the new file? The group ID of the new file can be the effective group ID of the process. The group ID of the new file can be the group ID of the directory in which the file is being created. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 11

67. What are the system Data files? Password file Group file Hosts Networks Protocols Services 68. Describe supplementary group id? Group Ids associated with a file other than the group Id in the password file are called as supplementary Group Id. 69. What are three functions that a data file should have? A get function that reads the next record, opening the file if necessary. A set function that opens the file(if not already open) and rewinds the file. An end entry that closes the data file. 70. What are the two data files that related to login/out process? utmp maintains the details of all users currently logged in. wtmp maintains the details of all login and logouts. 71. Explain the uname function? int uname(struct utsname *name); This function return information on the current host and operating system. 72. What are the different types of unformatted I/O? Character at a time I/O Line at a time I/O Direct I/O 73. How will you position a standard I/O stream? By using the functions ftell, fseek and fgetpos and fsetpos. ftell, fgetpos: to retrieve the current byte position fseek,fsetpos: to move the file pointer to specified place 74. List down the contents of password file. User name CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 12

Encrypted password Numerical user ID and group ID Comment field Initial working directory Initial shell 75. What do you mean by shadow password? The duplicate copy of password file is called password file. Minimally this file has the user name and the encrypted password. Other information relating to the password is also stored here. For example system with shadow passwordsoften required to choose a new password at certain intervals. 76. What are the different functions for system s data file? A get function that reads the next record, opening the file if necessary. These functions normally return a pointer to the structure. A null pointer is returned when the end of file is reached. A set function opens the file and rewinds the file. An end entry that closes the data file. 77. How will you identify the system in POSIX.1? The system is identified by using the function uname. This function return information on the current host and operating system. 78. List down the different time conversion functions? gmtime local time mktime asctime ctime strftime 79. Write a short note on File Sharing. The kernel uses three data structures to represent an open file, and the relationships among them determine the effect one process has on another with regard to file sharing. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 13

1. Every process has an entry in the process table. Within each process table entry is a table of open file descriptors, which we can think of as a vector, with one entry per descriptor. Associated with each file descriptor are a. The file descriptor flags b. A pointer to a file table entry 2. The kernel maintains a file table for all open files. Each file table entry contains a. The file status flags for the file, such as read, write, append, sync, and non-blocking. b. The current file offset. c. A pointer to the v-node table entry for the file 3. Each open file (or device) has a v-node structure that contains information about the type of file and pointers to functions that operate on the file. For most files, the v-node also contains the i-node for the file. This information is read from disk when the file is opened, so that all the pertinent information about the file is readily available. For example, the i-node contains the owner of the file, the size of the file, pointers to where the actual data blocks for the file are located on disk, and so on. 80. How the system calls are executed by the kernel? All system calls are executed in the kernel mode. Typically, UNIX kernels execute the following secure seven steps on a system call: 1. Arguments (if present) for the system call are determined. 2. Arguments (if present) for the system call are pushed in a stack. 3. The state of calling process is saved in a user structure. 4. The process switches to kernel mode. 5. The system call vector is used as an interface to the kernel routine. 6. The kernel initiates the services routine and a return value is obtained from the 7. Kernel service routine. 8. The return value is converted to a c version (usually an integer or a long integer). 81. Compare and contrast the dup and fcntl function. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 14

Another way to duplicate a descriptor is with the fcntl function. Indeed, the call dup(filedes); is equivalent to fcntl(filedes, F_DUPFD, 0); Similarly, the call dup2(filedes, filedes2); is equivalent to close(filedes2); fcntl(filedes, F_DUPFD, filedes2); In this last case, the dup2 is not exactly the same as a close followed by an fcntl. The differences are as follows. 1. dup2 is an atomic operation, whereas the alternate form involves two function calls. It is possible in the latter case to have a signal catcher called between the close and the fcntl that could modify the file descriptors. 2. There are some errno differences between dup2 and fcntl. 82. What you mean by delayed write? Traditional implementations of the UNIX System have a buffer cache or page cache in the kernel through which most disk I/O passes. When we write data to a file, the data is normally copied by the kernel into one of its buffers and queued for writing to disk at some later time. This is called delayed write. 83. Mention the purposes of fcntl function. The fcntl function is used for five different purposes. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 15

1. Duplicate an existing descriptor (cmd = F_DUPFD) 2. Get/set file descriptor flags (cmd = F_GETFD or F_SETFD) 3. Get/set file status flags (cmd = F_GETFL or F_SETFL) 4. Get/set asynchronous I/O ownership (cmd = F_GETOWN or F_SETOWN) 5. Get/set record locks (cmd = F_GETLK, F_SETLK, or F_SETLKW) 84. What are fields in password file? Description user name encrypted password numerical user ID numerical group ID comment field initial working directory initial shell (user program) user access class struct passwd member char *pw_name char *pw_passwd uid_t pw_uid gid_t pw_gid char *pw_gecos char *pw_dir char *pw_shell char *pw_class next time to change password time_t pw_change account expiration time time_t pw_expire 85. What are fields in group file? Description group name encrypted password numerical group ID struct group member char *gr_name char *gr_passwd int gr_gid array of pointers to individual user names char **gr_mem CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 16

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 17