Re: Fork Problem
- From: Jun Ma <ma_jun1973 yahoo com>
- To: Ronald Bultje <rbultje ronald bitfreak net>, francex tiscali it
- Cc: gtk-list gnome org
- Subject: Re: Fork Problem
- Date: Fri, 4 Apr 2003 10:06:53 +0800 (CST)
You should do it in this way:
gchar **options={"/usr/bin/gcc", "-v", NULL};
options[i] can't be initiated on run. YOu have to use
'strcpy()' after malloc space.
regards
--- Ronald Bultje <rbultje ronald bitfreak net>
的正文:> Hey,
>
> On Thu, 2003-04-03 at 14:06, francex tiscali it
> wrote:
> > gchar **options;
> >
> > options [0] = "/usr/bin/gcc";
> > options [1] = "-v";
> > options [2] = NULL;
>
> You're expecting this to work? ;-).
>
> gchar *options[3];
> options[0] = "/usr/bin/gcc";
> options[1] = "-v";
> options[2] = NULL;
>
> You're accessing a pointer as if it were allocated,
> but it isn't.
>
> > When I launch it, program crash with a "seg
> fault". This is strace output:
>
> Try to use a debugger such as gdb.
>
> Ronald
>
> --
> Ronald Bultje <rbultje ronald bitfreak net>
> Linux Video/Multimedia developer
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
_________________________________________________________
Do You Yahoo!?
雅虎通网络KTV, 随时随地免费卡拉OK~~
http://rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com//chat/index.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]