GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
READCONS(3) FreeBSD Library Functions Manual READCONS(3)

readcons - prompt console for input

#include <u.h>

#include <libc.h>

char *readcons(char *prompt, char *def, int secret)

Readcons prompts at the console for input. It returns a NUL-terminated buffer containing the input without a final newline. The buffer should be freed (and perhaps cleared first) when no longer needed.

If the user types an empty string (just a newline) and def is non-zero, then a copy of def is returned instead of the empty string.

If secret is non-zero, the input is not echoed to the screen.

A stripped-down version of netkey (see
pass = readcons("password", nil, 1);
passtokey(key, pass);
memset(pass, 0, strlen(pass));
free(pass);
for(;;){
	chal = readcons("challenge", nil, 0);
	sprint(buf, "%d", strtol(chal, 0, 10));
	free(chal);
	netcrypt(key, buf);
	print("response: %s0, buf);
}
    

/src/lib9/readcons.c

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.