du-4.0b and getlogin(2)

From: Bernt Christandl <beb_at_mpe.mpg.de>
Date: Tue, 29 Jul 1997 12:05:22 +0200

Hello managers,

is getlogin(2) broken under du-4.0b???

I have a small c-programm,

  #include <unistd.h>
  main() {
    char *val;
    val = getlogin();
    if ( val == (char *)NULL ) {
      perror("getlogin(2) failed");
    } else {
      printf("getlogin(2): login name = %s\n", val);
    }
  }

which runs under du-4.0a and returns the loginname,
while under du-4.0b an error is returned:

    getlogin(2) failed: Invalid argument


Obviously i've missed something? What's the problem here?

Thank you!

Bernt Christandl
                                                                       
----------------------------------------------------------------------
- Bernt Christandl / Max Planck Institut - Extraterrestrische Physik -
- D-85740 Garching / Phone: +49/89/3299-3342 / Fax: +49/89/3299-3569 -
- email: beb_at_mpe.mpg.de -
----------------------------------------------------------------------
Received on Tue Jul 29 1997 - 12:27:34 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT