Sponsored Content
Full Discussion: Extreme Beginner
Special Forums UNIX Desktop Questions & Answers Extreme Beginner Post 302916012 by Neo on Friday 5th of September 2014 05:39:20 PM
Old 09-05-2014
When the "file" is actually a "directory" the "execute" permissions become "search directory" permissions, so Jim's table looks something like this, for directories:

Code:
0 (no permission)
1 search
2 write
3 search + write
4 read
5 read + search
6 read + write
7 read + write + search

This User Gave Thanks to Neo For This Post:
 

3 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Beginner Help

hi guys, i have a DEl xps laptop cor 2 duo 2.2 i have vista installed on it i want to install a dual Boot UNIX on it.. can some one guide me ...cause i m tottaly new to UNIX i want to install unix on that laptop along with Vista.... thx any help would be deeply appreciated (sorry if i... (5 Replies)
Discussion started by: Farhan082
5 Replies

2. Shell Programming and Scripting

Beginner Help

I need to write a script to test a nsort c program. I have written 8 .txt files with different cases. Also 8 .txt files with expected outcome. The shell I have written always "test pass" for the first case but always "fail" for the rest... Here is a portion of my code (as I still don't know how to... (5 Replies)
Discussion started by: thibodeau
5 Replies

3. UNIX for Dummies Questions & Answers

Beginner - What Should I Do First?

Hi people.... I have just started to learn unix.I want to know which version of Unix to install plus how to install it.I need to practise and make myself aware of how unix works.My thread is from an educational point of view.Also please feel free to give your suggestions as I am... (3 Replies)
Discussion started by: amit.kanade1983
3 Replies
TTYSLOT(3)						     Linux Programmer's Manual							TTYSLOT(3)

NAME
ttyslot - find the slot of the current user's terminal in some file SYNOPSIS
#include <unistd.h> /* on BSD-like systems, and Linux */ #include <stdlib.h> /* on System V-like systems */ int ttyslot(void); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): ttyslot(): _BSD_SOURCE || (_XOPEN_SOURCE_EXTENDED && ! _XOPEN_SOURCE >= 500) DESCRIPTION
The legacy function ttyslot() returns the index of the current user's entry in some file. Now "What file?" you ask. Well, let's first look at some history. Ancient History There used to be a file /etc/ttys in Unix V6, that was read by the init(8) program to find out what to do with each terminal line. Each line consisted of three characters. The first character was either '0' or '1', where '0' meant "ignore". The second character denoted the terminal: '8' stood for "/dev/tty8". The third character was an argument to getty(8) indicating the sequence of line speeds to try ('-' was: start trying 110 baud). Thus a typical line was "18-". A hang on some line was solved by changing the '1' to a '0', signaling init, changing back again, and signaling init again. In Unix V7 the format was changed: here the second character was the argument to getty(8) indicating the sequence of line speeds to try ('0' was: cycle through 300-1200-150-110 baud; '4' was for the on-line console DECwriter) while the rest of the line contained the name of the tty. Thus a typical line was "14console". Later systems have more elaborate syntax. System V-like systems have /etc/inittab instead. Ancient History (2) On the other hand, there is the file /etc/utmp listing the people currently logged in. It is maintained by login(1). It has a fixed size, and the appropriate index in the file was determined by login(1) using the ttyslot() call to find the number of the line in /etc/ttys (counting from 1). The semantics of ttyslot Thus, the function ttyslot() returns the index of the controlling terminal of the calling process in the file /etc/ttys, and that is (usu- ally) the same as the index of the entry for the current user in the file /etc/utmp. BSD still has the /etc/ttys file, but System V-like systems do not, and hence cannot refer to it. Thus, on such systems the documentation says that ttyslot() returns the current user's index in the user accounting data base. RETURN VALUE
If successful, this function returns the slot number. On error (e.g., if none of the file descriptors 0, 1 or 2 is associated with a ter- minal that occurs in this data base) it returns 0 on Unix V6 and V7 and BSD-like systems, but -1 on System V-like systems. CONFORMING TO
SUSv1; marked as LEGACY in SUSv2; removed in POSIX.1-2001. SUSv2 requires -1 on error. NOTES
The utmp file is found various places on various systems, such as /etc/utmp, /var/adm/utmp, /var/run/utmp. The glibc2 implementation of this function reads the file _PATH_TTYS, defined in <ttyent.h> as "/etc/ttys". It returns 0 on error. Since Linux systems do not usually have "/etc/ttys", it will always return 0. Minix also has fttyslot(fd). SEE ALSO
getttyent(3), ttyname(3), utmp(5) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2007-11-26 TTYSLOT(3)
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy