|
|
Le 12/03/2011 07:57, Jess nous fit lire :
> Le_Forgeron <jgr### [at] freefr> wrote:
>> Le 11/03/2011 21:57, Jess nous fit lire :
>>> I didn't try turning off the display until today, but that also didn't work.
>>>
>>>
>> How does "povray --benchmark" perform from your webserver/php ?
>> (and directly from command line ?)
>
> The benchmark render took 22 minutes to complete from the command line, but
> didn't work at all from PHP (running it with system still gives me a return
> value of 1, which I found out is a generic error code).
>
>
Ok, time to switch povray for a hello_world program then.
(i.e. write & compile a hello_world program, and get it called from
shell then php/webserver.
1. Does it work the same ? (does it fail the same way ?)
2. second level debugging: add more printf in the the hello program to
display:
* all the arguments/parameter (including argv[0]),
* process id ( getpid() )
* user id (both real & effective : getuid(), geteuid() )
* current directory ( getcwd() or get_current_dir_name() )
* perform some i/o operation on the disk (like opendir("/tmp"), and
display all entries ? compare with actual content of /tmp)
Something like that:
-----------------------
#include <sys/types.h>
#include <dirent.h>
int main(int argc,char**argv)
{
int ii;
DIR* tmpdir;
struct dirent *entry;
printf("Hello, world\n");
for(ii=0;ii<argc;ii++)
{
printf("arg %d : \"%s\"\n",ii,argv[ii]);
}
printf("This is pid %d\n",getpid());
printf("Run as user %d (effective %d)\n",getuid(),geteuid());
printf("The current directory is : %s\n",get_current_dir_name());
tmpdir=opendir("/tmp");
printf("Opendir /tmp returned: %p\n",tmpdir);
if (tmpdir)
{
do
{
entry = readdir(tmpdir);
if (entry)
{
printf("Filename %s\n",entry->d_name);
}
} while (entry);
ii=closedir(tmpdir);
printf("Closedir returned %d\n",ii);
}
return 0;
}
----------------
Post a reply to this message
|
|