sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #12566
Re: Netscape startup
On Sun, Aug 29 1999, Hans Jørgensen wrote:
> >#include <fcntl.h>
> >#include <stdio.h>
> >#include <stdlib.h>
> >#include <sys/stat.h>
> >#include <unistd.h>
> >
> >#define NETSCAPE "/opt/netscape/netscape"
> >
> >int main(int argc, char *argv[])
> >{
> > int fd = open(NETSCAPE, O_RDONLY);
> > struct stat s;
> > char *foo;
> >
> > fstat(fd, &s);
> > foo = (char *)malloc(s.st_size + 1);
> > read(fd, foo, s.st_size);
> > execv(NETSCAPE, argv);
> > free(foo);
> >
> > return 0;
> >}
>
> ØØh ..
> -------------
> [Bash] borisj ~ > netscape
> /usr/local/bin/netscape: syntax error near unexpected token main(i'
> /usr/local/bin/netscape: /usr/local/bin/netscape: line 11: int main(int
> argc, char *argv[])'
> ------------
> Skal den gøre sådan ?
Ok, husk at sørge for at NETSCAPE faktisk peger på den Netscape
du har på din maskine. Hvis du ikke har /opt linket til /usr/local
kan du rette NETSCAPE så den passer.
Dernæst skal du kompilere programmet, ala (afhængigt af hvad
du rent faktisk kaldte ovenstående fil.
[axboe@burns netscape]$ gcc -Wall -o nets nets.c
Og så kan du starte Netscape med
[axboe@burns netscape]$ ./nets
for at teste at det virker.
--
* Jens Axboe <axboe@xxxxxxxx>
* Linux CD-ROM Maintainer
* http://www.kernel.dk
References