[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perguntas que fizeram sobre o linux



 --- Rodrigo <rodrigo@natalaco.com.br> escreveu: 
> 1. Se existe chamada de sistema no linux ( com exemplo ) ?
   Todo sistema operacional tem chamadas ao sistema, se não, nada
funcionaria.  Segue um programinha adaptado de "Advanced Programming in
the Unix Environment" do W. Richard Stevens:

#include        <signal.h>
#include        <stdio.h>

static void     sig_usr(int);   /* one handler for both signals */

int
main(void)
{
        if (signal(SIGUSR1, sig_usr) == SIG_ERR)
                fprintf(stderr, "can't catch SIGUSR1");
        if (signal(SIGUSR2, sig_usr) == SIG_ERR)
                fprintf(stderr, "can't catch SIGUSR2");

        for ( ; ; )
                pause();
}
static void
sig_usr(int signo)              /* argument is signal number */
{
        if (signo == SIGUSR1)
                printf("received SIGUSR1\n");
        else if (signo == SIGUSR2)
                printf("received SIGUSR2\n");
        else
                fprintf(stderr, "received signal %d\n", signo);
        return;
}

 
> 2. como funciona a opção do "shutdow -g0"
man shutdown
> 3. Como fazer para mostrar o caminho completo no prompt ( ex: <root@
> host /home/diretoriox> 
export "PS1=\[\033[01;33m\]\u \[\033[01;31m\] \[\033[01;32m\]\w
\[\033[01;33m\]$ -> \[\033[00m\]"
Para maiores informações: man bash (procure por PROMPTING)



__________________________________________________
Converse com seus amigos em tempo real com o Yahoo! Messenger 
http://br.download.yahoo.com/messenger/ 



Reply to: