You close /dev/tty which has 3 attached file descriptors 0 -stdin, -stdout, 2 -stderr.
In C
bash:
Of course after you do this you cannot control the process except by signal - kill [process pid]
I just changed from windows NT to XP and I am no longer able
to connect to my unix system. I used to use hyper terminal -- which acts as dumb terminal to my main frame unix system. I think one of the options used to be "direct to comX". This option isn't listed now. I use a serial port and the... (2 Replies)
A programming running in tty0 crashes.
In a second terminal I kill all the processes.
Can i start the program again from this terminal?
Yes, I can, but it starts in tty1, and when i close the terminal, the program closes.
Now I want to start the program from tty1 in tty0, so i can close... (4 Replies)
Hellp all,
if there is 3G memory in my Unix server I want to know if all the 3G space can be used by ong sigle process. As i know, in Windows, one process can only access at most 1G memory despite there is probably more than 1G memory is equipped. (1 Reply)
I pressed CTRL Z and suspended the job. then I pressed bg, The process re-started to throw output on the terminal and its not allowing me to access the prompt.
its not even accepting CTRL Z. The process has been running for about 2 hours now and I want to suspend it by opening another terminal.... (3 Replies)
Hi Folks,
When i try to run schedule job on Unix server am getting following errror messges in logs
pic_selection @starting on Fri Feb 5 01:53:06 GMT 2010
-------------------------------------------------------------------------------
Microfocus Cobol batch run
Started: Fri Feb 5... (4 Replies)
Hi *,
please, I need fast tip (help). I have a process starting through /etc/rc3.d/xxxx script. However, sometimes (mostly because of testing reasons) I need to stop the process, change something and then start it again. But:
1) when I start it in terminal, the process dies when I leave the... (2 Replies)
Hi All,
i ve a process,
user4 31779 2836 0 01:43 pts/6 00:00:00 sh /home/user/DATE/SUT_SCR/c.sh
like this i'll get so many process when in run ps -ef | grep pts | grep c.sh
i need to extract terminal id from this string. i.e pts/6, or sometimes pts/22 same way i need to do for... (3 Replies)
I do not wish to install Unix or Linux locally be it on my system or my Virtual box.
I am looking for an online free Linux / Unix Terminal that i can connect and use.
Something like ... Unix Terminal Online
But the problem with Unix Terminal Online] is that i CANNOT ping it's ip which i... (3 Replies)
Hi,
I new to AIX, and I have been using Rocket UniData in it. I had to set up a Process for Data Exchange by assigning a unique Terminal and a Socket Port to that process. I ran the process for the first time and it was successful and after use I stopped the process. Now when I want to run it... (3 Replies)
Discussion started by: BejoyS
3 Replies
LEARN ABOUT HPUX
getlogin_r
getlogin(3C)getlogin(3C)NAME
getlogin(), getlogin_r() - get name of user logged in on this terminal
SYNOPSIS DESCRIPTION
The function retrieves the name of the user currently logged in on a terminal associated with the calling process, as found in user-
accounting database maintained by utmpd(1M).
At least one of the standard input, standard output, or standard error must be a terminal. For the first of these found that is a termi-
nal, a user must have logged in on that terminal, and that terminal must be the controlling terminal of the session leader process of the
calling process's session.
The function can be used in conjunction with to locate the correct password file entry when the same user ID is shared by several login
names.
The recommended procedure to obtain the user name associated with the real user ID of the calling process is to call and if that fails, to
call
To get the user name associated with the effective user ID, call
performs the same operations as but returns the login name in the buffer to which buf points, whose size in bytes should be passed in
buflen. buf should have space for the name and the terminating null character. The maximum size of the login name can be obtained using
the API with as the argument.
APPLICATION USAGE
The return value from points to static data whose content is overwritten by each call.
RETURN VALUE
Upon successfully finding and validating the login name of the user logged in on the terminal, returns a pointer to the name. Otherwise,
it returns a null pointer, and sets to indicate the error.
Upon successfully finding, validating, and copying to the buffer the login name of the user logged in on the terminal, returns 0 upon suc-
cess and returns an error number upon failure.
ERRORS
and fail if any of the following is true:
[EACCES] Access permission to get the status of the terminal device file, was denied.
[EMFILE] Too many file descriptors are in use by this process.
[ENFILE] Too many file descriptors are in use on the system.
[ENOENT] The terminal device file cannot be found.
[ENOTTY] None of the standard input, standard output, or standard error is a terminal, or for the first of these that is a
terminal, no current login is registered on that terminal, or the session leader process of the calling process has
no controlling terminal.
[EPERM] One of the standard input, standard output, or standard error is a terminal, and a current login was found on that
terminal, but that terminal is not the same as the controlling terminal of the session of the calling process.
[ESRCH] The session leader process of the calling process is no longer running.
The error condition associated with [EPERM] prevents processes that have access to some other user's terminal from believing that they are
related to that other user's login session.
also fails if the following is true:
[ERANGE] The length of the name to be returned, including the terminating null byte, exceeds buflen.
WARNINGS
Users of should note now conforms with the POSIX.1c Threads standard. The old prototype of is supported for compatibility with existing
DCE applications only.
SEE ALSO utmpd(1M), getuid(2), sysconf(2), getgrent(3C), getpwent(3C), thread_safety(5).
STANDARDS CONFORMANCE getlogin(3C)