Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ttyname() and ESRCH: (1 Item)
   
ttyname() and ESRCH  
Here's a question about another old PR.

PR 24628 says:

  Under certain, yet unclear conditions, ttyname() rsp. ttyname_r() can 
  fail with errno code ESRCH. This case is not documented.

I looked at the code for ttyname_r(), and it calls:

  devctl()
  ConnectServerInfo()
  netmgr_ndtostr()
  strlen()
  strcpy()

According to our docs, the only one of these that can give ESRCH is ConnectServerInfo(), and that occurs if the process 
with the given pid doesn't exist. However, ttyname() calls it with a pid of 0.

Any ideas where the ESRCH could be coming from?

Thanks.