#1119 closed defect (fixed)

sysctl interface is not working

Reported by: thomas.doerfler Owned by: Eric Norum
Priority: highest Milestone: 2
Component: network/legacy Version: 4.6
Severity: critical Keywords:
Cc: bugs@…, thomas.doerfler@… Blocked By:


The sysctl interface allows the application to modify lots of variables used in the network stack. It is not working in rtems-, because GCC optimization removes the data structures that define the access to these variables.
Reason: the named data structures are marked with the attribute "unused" to avoid "variable unused" warnings. GCC-4 silently removes these variables. Using the attribute "used" instead will fix this.

4.6.99.x with GCC4.x

PowerPC targets (and probably others aswell)

Tryint to access the variable "TCPCTL_KEEPINTVL" with the following code will fail:


  • try to tweak some network stack variables */


int old_keepintvl;
size_t old_keepintvl_size = sizeof(old_keepintvl);
int new_keepintvl = 8;
printf("calling sysctl for tcp_keepalive\n");
sc = sysctl(name,sizeof(name)/sizeof(name[0]),


printf("sysctl returned %d\n",sc);


Attachments (1)

rtems- (2.7 KB) - added by thomas.doerfler on Dec 3, 2006 at 1:31:13 PM.

Download all attachments as: .zip

Change History (2)

comment:1 Changed on Sep 12, 2006 at 5:54:25 PM by thomas.doerfler

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: problem has been fixed

Changed on Dec 3, 2006 at 1:31:13 PM by thomas.doerfler

Attachment: rtems- added


Note: See TracTickets for help on using tickets.