Skip to contentSkip to conversation

envlist_setenv...

Qemu-devel Davide 2 participants 4 messages Jan 10, 2012 – Jan 18, 2012

lore
Share & tools
lore

Davide

author
#0 lore raw

What does this loop in main?

for (wrk = environ; *wrk != NULL; wrk++) {
        (void) envlist_setenv(envlist, *wrk);
    }
author
#1 lore raw

What does this loop in main?

for (wrk = environ; *wrk != NULL; wrk++) {
        (void) envlist_setenv(envlist, *wrk);
    }
#2 lore raw

Hi,

Quoted 5 lines

What does this loop in main?

for (wrk = environ; *wrk != NULL; wrk++) {
         (void) envlist_setenv(envlist, *wrk);
     }

You can check envlist.[ch] first. I think what the loop does is copying host
environ (user environment. HOME, SHELL, PATH...etc) to struct envlist (envlist.c). Latter on, QEMU calls function envlist_to_environ to transform envlist to target environ which is used by the guest application.

HTH,
chenwj

Signature · 5 lines
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj
#3 lore raw
In reply to Davide
Quoted 6 lines · Davide

What does this loop in main?

for (wrk = environ; *wrk != NULL; wrk++) {
         (void) envlist_setenv(envlist, *wrk);
     }

Seems the return value (error code) of envlist_setenv is ignored here...

Signature · 5 lines
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj