Getpwnam_r returning null with errno 25


 
Thread Tools Search this Thread
Top Forums Programming Getpwnam_r returning null with errno 25
# 1  
Old 05-27-2013
Getpwnam_r returning null with errno 25

I am calling getpwnam_r with all proper argument as below:-

Code:
rv = getpwnam_r(name, result, buffer, buflen);

This program runs fine on sol 8/9/10.
But on sol 11 it returns NULL with errno set to 25
Code:
(#define ENOTTY  25      /* Inappropriate ioctl for device       */)

All boxes are using NIS and my user id is in NIS.

What could be wrong on my sol11 box?

Code:
uname -a output:-
SunOS hostname 5.11 11.0 sun4v sparc SUNW,Sun-Fire-T200

Regards
Ranajit

Last edited by jim mcnamara; 05-27-2013 at 08:53 AM..
# 2  
Old 05-27-2013
There is a problem here. ENOTTY is not an error you can get from calling getpwnam().

The problem has to have occurred before that call. Therefore, errno was set to ENOTTY before you called getpwnam().
# 3  
Old 05-28-2013
I thought there could be issue with patch so tried in another box where it worked
as expected. So problem is resolved. But I need to find out what was the problem
in first box. From man page I suspect issue could be nsswitch.conf also.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Errno.h symbols

Hi, I need to look at a recent copy of /usr/include/errno.h from AIX 7.2 to check some symbols. In particular, I'm curious if it defines EOWNERDEAD and ENOTRECOVERABLE. Can someone who has access to 7.2 please check for me? Thanks! (1 Reply)
Discussion started by: topcat
1 Replies

2. Programming

Malloc function returning NULL

Hi All, I am using malloc function for allocating dynamic memory. When I am using below code on Linux server its working fine, but When I am trying the same code on HP UNIX server its returning NULL. below is a fragment of code in which it is giving problem. tmp = (format_tree... (4 Replies)
Discussion started by: Taher Saifuddin
4 Replies

3. UNIX for Advanced & Expert Users

getservbyname returning NULL

OS : Solaris 10 When I try to get the "echo" service port, getservbyname is returning null. I checked - /etc/services having an entry for echo - echo 7/tcp (But still getservbyname returning null) Any other config required to consider? (1 Reply)
Discussion started by: satish@123
1 Replies

4. Shell Programming and Scripting

Insert string 'NULL' where there is a null value

I have an input file having 7 fields delimited by , eg : 1,ABC,hg,1,2,34,3 2,hj,YU,2,3,4, 3,JU,kl,4,5,7, 4,JK,KJ,3,56,4,5 The seventh field here in some lines is empty, whereas the other lines there is a value. How do I insert string NULL at this location (7th loc) for these lines where... (8 Replies)
Discussion started by: zilch
8 Replies

5. Shell Programming and Scripting

Script returning null results

Hi, The following shell script returning null results could you please tell me whats the problem in script, ********************************* #!/bin/ksh . $HOME/conf/systemProperties/EnvSetup.properties a=`date +"%y%m%d"` set -x for i in `cat... (2 Replies)
Discussion started by: shivanete
2 Replies

6. Programming

getservbyport - Always returning NULL servent

Hi, I am having an issue using getservbyport. Here is a little program to demonstrate the problem (removed the includes): int main(void) { struct servent *service; int memsize = sizeof(struct servent); service = (struct servent *)malloc(memsize); ... (2 Replies)
Discussion started by: goon12
2 Replies

7. Programming

errno

Hey, Can I assume that for certain function calls, errno can never be set to a certain value. More specifically, can I assume that for if the stat function call fails, the errno can never be or "No space left on device." I am assuming that a read function cannot fail because of no space... (5 Replies)
Discussion started by: the_learner
5 Replies

8. UNIX for Dummies Questions & Answers

malloc returning NULL if freemem high & swapmem low (MPRAS version 3.03 )

Hi All,:) In my application malloc is returning NULL even though there is sufficient amount of free memory available but the swap memory is low. Is this possible that, if free memory is high & swap memory is low, malloc will not be able to allocate memory & return NULL ? Few details: ... (4 Replies)
Discussion started by: Ritesh Kumar
4 Replies

9. Solaris

malloc returning NULL if freemem high & swapmem low

Hi All, In my application malloc is returning NULL even though there is sufficient amount of free memory is available but swap memory is low. Is this possible that, if free memory is high & swap memory is low, malloc will not be able to allocate memory & return NULL ?:) Kindly look into... (5 Replies)
Discussion started by: Ritesh Kumar
5 Replies

10. Programming

errno pb

Hello, I need to make a lib with pthread, when I run my make file all is good. But when I run my test program, I test errno in the begining and is already set to 251. Is it normal ??? What can I modify in my Makefile to have errno set to 0 ??? Thanks $make gcc -D_REENTRANT -shared -fpic... (3 Replies)
Discussion started by: dts
3 Replies
Login or Register to Ask a Question