User ID width


 
Thread Tools Search this Thread
Operating Systems Linux User ID width
# 1  
Old 04-09-2005
User ID width

in terms of bits, what is the width of a User ID? seems like I remember it being 32-bit (maybe wrong) but I can't find anything anywhere on ther subject.
# 2  
Old 04-09-2005
Quote:
Originally Posted by thmnetwork
in terms of bits, what is the width of a User ID? seems like I remember it being 32-bit (maybe wrong) but I can't find anything anywhere on ther subject.
It's 2 bytes, I guess...
# 3  
Old 04-09-2005
Quote:
Originally Posted by thmnetwork
in terms of bits, what is the width of a User ID? seems like I remember it being 32-bit (maybe wrong) but I can't find anything anywhere on ther subject.
Hi !
Look at this :
Code:
     UID     Automatically generated or your choice.  It must be less than
             32000.

This is what I found in the "adduser" manual page.
As long as the UID must be under 32000, I'm sure that it is an int value, and that means 2 bytes (on most of the computers).
So, I gues that this answered your question Smilie
Bye !
# 4  
Old 04-09-2005
yeah thank you for the reply, I have a follow up question.

it says it must be below 32k

well I did some math and 2^15 is 32768, so I'm assuming that's where they're getting it from.

since it's 8 bits (1 byte) followed by 7 bits, I'm assuming the 16th bit is being used as a sign bit.

if it is a signed bit, then that begs the question: "When would it be deemed appropriate to give someone a negative userID?"
# 5  
Old 04-09-2005
Some systems do in fact use negative uids, for example on some flavours of GNU/Linux -1 is used for the "nobody" user.

Last edited by reborg; 04-09-2005 at 03:18 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Joining fixed width files

Hi All, I need to join fixed width files on a column which is position 1 to 3 and need to have all the records from file1 file1.txt Cu1nullL1L2 Cu2nullL1L2 Cu3nullL1L2 file2.txt Cu1B1B2 Cu3B1B2 output.txt Cu1L1B1L2B2 Cu2L1L2 Cu3L1B1L2B3 I tried but not getting the expected... (12 Replies)
Discussion started by: shash
12 Replies

2. Red Hat

How to know full width blade or half width blade?

HI, How do we figure out if the server is half blade server or full blade server? Anything we need to look at to know on this? thanks in advance (9 Replies)
Discussion started by: snchaudhari2
9 Replies

3. Shell Programming and Scripting

Fixing the width of a word

Is there a way to fix the width of the word being printed to a file? I am trying to create an output to a file with columns , like a spread sheet. I have used "\t" to adjust the columns but still it does not show well in the file, mainly due to the variable length values in the column so \t does... (1 Reply)
Discussion started by: davidtd
1 Replies

4. Programming

get terminal width and height

I was reading Advanced Programming in the Unix Environment and it says to use ioctl() to get the terminal's width and height. I wrote this program: // print width and height #include <stdio.h> #include <unistd.h> #include <sys/ioctl.h> #include <termios.h> int main( int argc, char... (3 Replies)
Discussion started by: Ultrix
3 Replies

5. Shell Programming and Scripting

Comparing two fixed width file

Hi Guys I am checking the treads to get the answer but i am not able to get the answer for my question. I have two files. First file is a pattern file and the second file is the file i want to search in it. Output will be the lines from file2. File1: P2797f12af 44751228... (10 Replies)
Discussion started by: anshul_er
10 Replies

6. UNIX for Dummies Questions & Answers

top's USER column width variation

hello, does anyone know how to expand the column width so it could contain full USER cell and not cut it in top ? Now it has eleven symbols but I can see only eight actualy I found only PID, PPID and %CPU columns variation possibilities in changelog (procps v.3.2.5). thanks in advance. (1 Reply)
Discussion started by: bugs_moran
1 Replies

7. Programming

terminal Width/height change

Hi, i am very new to unix/linux programming. for one of the application i have to change the Terminal width and height. i did try this if (ioctl (fd, TIOCGWINSZ, &win)) return; if (y && y >24) win.ws_row = y; else win.ws_row = 24; if (x && x>80)... (2 Replies)
Discussion started by: bgsunny
2 Replies

8. UNIX for Dummies Questions & Answers

text width

Hi, Can anyone tell me how to restrict the size of the text in a file (to say 72 chars). I can do this within vim by using textwidth variable, but would like to do this from command line. I even vaguely remember using this command, but dont seem to recall it now. Regards (2 Replies)
Discussion started by: sharanbr
2 Replies

9. UNIX for Dummies Questions & Answers

Command Line width parameter

can someone please tell me how i can increase the number of characters that can be input on the command line? (2 Replies)
Discussion started by: Scoogie
2 Replies
Login or Register to Ask a Question