fflush doesn't work on SunOS 4.1 ?

fflush doesn't work on SunOS 4.1 ?

Post by Peifong R » Sat, 18 May 1991 23:22:34

Can someone help me with this problem?

In going from Sun OS 3.5 to 4.1, it seems that fflush(stdin) no longer
clears the keyboard input buffer.  Is this true, and how should I clear
keyboard input under 4.1?

In the example program below, when compiled under 4.1, the <return> from
the user's first typein remains in the buffer after the scanf and
so it is seen by the getc, and the the user never has a chance to supply
the second typein.


#include <stdio.h>
int i;
main() {
  printf("type a number and <return>: ");
  scanf("%d", &i);
  fflush(stdin); /* flush any arg terminator char */
  printf(" type a single char and <return>: ");
  i = getc(stdin);
  printf(" char=%d\n", i);



1. SunOS 4.1 / 4.1.1 / 4.1.1U_1 /usr/etc/rpc.yppasswdd doesn't work.

We have a problem.

We run NIS on our public-access system.  (This in itself is not quite
the problem.  B^>)

We run a network of Sun 3s with 4.1.1 and 4.1.1U_1.

We can't get passwd to work correctly to change the NIS password (ie
setting a non-local password).

Tracing yppasswdd to see what's happening, with the 4.1.1U_1 version
the program opens the passwd file twice when the second time it should
have opened the adjunct file, so it thinks the quoted old password is
bad and refuses to store the new one.

Tracing the 4.1.1 version (and I've even tried the 4.1 version),
yppasswdd gets a SIGSEGV a little after creating the adjunct ptmp file,
so it doesn't get to create the new entry and subsequent attempts to
set passwords inform us that the password file is `busy' (the .ptmp
file is there albeit size zero).

Can we fix this?


2. Diagnosing SPARCstation5 boot problems

3. SunOS 4.1 box doesn't want to see DNS anymore

4. E3500 AP problem

5. renice doesn't work in AIX 4.1

6. Loggin in to a Windows Domain from Linux

7. WANTED: Solaris 2 equivalent to SunOS 4.1.X's 'showfh' cmd

8. creating partitions on separate physical drives.

9. Can't pipe stdout into 'cat', using g++/libg++ on SunOS 4.1

10. Mouse doesn't work after installing XFree86 4.1

11. PPPD and Redhat 4.1 - doesn't work with digital phone lines?

12. Is there something like 'shutdownrc' at SunOS 4.1 ?

13. Re. bffcreate -X doesn't work Re: bffcreate -X Doesn't Work