Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(384)

Issue 41044: Add simu_getopt_long_r

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 11 months ago by Hajime Tazaki
Modified:
14 years, 11 months ago
Reviewers:
Mathieu Lacage
CC:
ns-3-reviews_googlegroups.com
Visibility:
Public.

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+0 lines, -2 lines) Patch
M src/process-manager/libc-global-variables.c View 1 chunk +0 lines, -2 lines 4 comments Download

Messages

Total messages: 5
Hajime Tazaki
14 years, 11 months ago (2009-04-14 16:20:25 UTC) #1
Mathieu Lacage
http://codereview.appspot.com/41044/diff/1/2 File src/process-manager/libc-global-variables.c (left): http://codereview.appspot.com/41044/diff/1/2#oldcode11 Line 11: int optind = 0, opterr = 0, optopt ...
14 years, 11 months ago (2009-04-15 07:19:03 UTC) #2
Hajime Tazaki
http://codereview.appspot.com/41044/diff/1/2 File src/process-manager/libc-global-variables.c (left): http://codereview.appspot.com/41044/diff/1/2#oldcode11 Line 11: int optind = 0, opterr = 0, optopt ...
14 years, 11 months ago (2009-04-15 15:38:53 UTC) #3
Mathieu Lacage
http://codereview.appspot.com/41044/diff/1/2 File src/process-manager/libc-global-variables.c (left): http://codereview.appspot.com/41044/diff/1/2#oldcode11 Line 11: int optind = 0, opterr = 0, optopt ...
14 years, 11 months ago (2009-04-17 12:03:38 UTC) #4
Hajime Tazaki
14 years, 11 months ago (2009-04-17 16:06:42 UTC) #5
http://codereview.appspot.com/41044/diff/1/2
File src/process-manager/libc-global-variables.c (left):

http://codereview.appspot.com/41044/diff/1/2#oldcode11
Line 11: int optind = 0, opterr = 0, optopt = 0;
On 2009/04/17 12:03:38, Mathieu Lacage wrote:
> If you have two processes (A,B), within a single node (N), A and B should have
a
> different version of these global variables and the current ELF loader does
> ensure that. Of course, if you have multiple threads (TA1, TA2) within process
> A, they will share the _same_ global variables which are different from the
> variables seen by TB1, TB2.

Okay, I got the point.

So how about the following diff ?

src/process-manager/libc.c:
extern "C" void LIBSETUP (const struct Libc *fn)
{
 :
+  optarg = fn->optarg;
+  optind = fn->optind;
+  opterr = fn->opterr;
+  optopt = fn->optopt;
}

src/proces-manager/libc.h:
struct Libc
{
  :
+  char *optarg;
+  int optind;
+  int opterr;
+  int optopt;
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b