In Darwin, when typing "ifconfig en0 media 10baseT/UTP mediaopt half-duplex" I recieve the error message "ifconfig: SIOCSIFMEDIA: Operation not permitted". The same thing occurs when I sudo the command. Any suggestions?
Thanks... (1 Reply)
hi all,
i have been trying to get a script working that can take in more than one option using getopt. But for some reason, even when i type in a covered option, it skips directly to my error message of "no match." Any ideas of what might be wrong?
set - 'getopt frd*: $*'
for i in $*
do... (6 Replies)
I am using gcc3.3.5 on solaris2.7. Its a 64 bit compilation
I am compiling a file 'plugin.cpp'. It includes mach.h and the complation gives the following error.
-----------------------------------------------------------------
mach.h error: conflicting
types for `typedef vx_u32_t... (0 Replies)
I am just learning Tcl and there are few things about it that is perplexing me. I have a question about the switch statement.
Why are these two switch statements giving me different results?
$ cat test_switch.tcl
#!/usr/bin/tcl
set foo "abc"
switch abc a - b {puts "No. 1"} $foo {puts... (2 Replies)
hi,
how to access console of a switch having rj45 on switch side to db 9 female on pc side console cable which needs to be connected to one console server having rj11 on its side and db 9 female on other end.i.e. on switch side,console cable has rj45 and db 9 pin female connector on other side of... (1 Reply)
I started writing a script to save the files from a camera I got the other day, which mounts in /Volumes , and I got into it and started building this menu. The only problem is that the switch case is coming up as a syntax error at the parenthesis after a case. Here is the code:
while :
do
... (2 Replies)
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
Hello All,
Here I am trying to login a Linux machine as admin user from a Solaris box..
& then switch to root user..
Code I use:
ssh admin@<IP> << END
su - root << A
echo "Hello I am logged in as root"
exit
A
exit
END
But the error I get..
su: must be run from a... (3 Replies)
Having trouble with the logic when looping over this switch case again:
for (j = 0; data != 0; j++){
switch(data){
case 'c':
output = ranit(r_brace_array);
break;
case 'h':
output = ranit(pipe_array);
break;
... (6 Replies)
Discussion started by: Azrael
6 Replies
LEARN ABOUT OSF1
getsvc
getsvc(3) Library Functions Manual getsvc(3)NAME
getsvc - Gets a pointer to the svcinfo structure.
SYNOPSIS
#include <sys/svcinfo.h>
struct svcinfo *getsvc()
DESCRIPTION
The getsvc call retrieves information from the system about the svcinfo structure by returning a pointer to the structure. This structure
is initialized the first time a getsvc call is made. The contents of the /etc/svc.conf file are parsed and stored in the svcinfo struc-
ture. If the /etc/svc.conf file is modified, the contents of this structure will be updated upon the next getsvc call.
The /etc/svc.conf file contains the names of the databases that can be served by BIND or local files and the name service selection for
each database. It also has settings for four security parameters. The database service selection and security parameters are stored in
the svcinfo structure.
The following structure exists in the <svcinfo.h> file: #define SVC_DATABASES 20 #define SVC_PATHSIZE 8 struct svcinfo {
int svcdate; /* Last mod date of /etc/svc.conf */
int svcpath[SVC_DATABASES][SVC_PATHSIZE]; /* indexed by
databases and choice 0=first choice 1=second choice, etc value stored is
source */
struct {
int passlenmin;
int passlenmax;
int softexp;
int seclevel;
} svcauth; };
The svcdate field contains the date that the /etc/svc.conf file was last modified. The svcpath array contains the name service choices
for each database. The svcauth structure contains the values for the four security parameters: password length minimum (passlenmin), pass-
word length maximum (passlenmax), soft expiration date of a password (softexp), and security mode of a system (seclevel).
EXAMPLES
The following programming example shows how to use the getsvc call to use the information in the svcinfo structure to process specific host
information. #include <sys/svcinfo.h> struct svcinfo *svcinfo;
if ((svcinfo = getsvc()) != NULL)
for (i=0; (j = svcinfo->svcpath[SVC_HOSTS][i]) != SVC_LAST; i++) switch(j) { case SVC_BIND: /* process BIND
hosts */ case SVC_YP: /* process YP hosts */ case SVC_LOCAL: /* process LOCAL hosts */ }
FILES RELATED INFORMATION svc.conf(4), svcsetup(8) delim off
getsvc(3)