Date: Wed, 16 Oct 2013 21:45:20 -0400 From: Eitan Adler <lists@eitanadler.com> To: Sebastian Huber <sebastian.huber@embedded-brains.de> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: Global variables in system programs Message-ID: <CAF6rxgn4bLJ1VQp-_ucoqVm9SJEmo8=sH49k7HxJO3Y9JRZcww@mail.gmail.com> In-Reply-To: <525D5A35.4040005@embedded-brains.de> References: <525D5A35.4040005@embedded-brains.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 15, 2013 at 11:07 AM, Sebastian Huber <sebastian.huber@embedded-brains.de> wrote: > These programs use some global variables. In a statically linked context we > have now the following problems This is a pretty awesome idea. I've seen some work like this but it would be great to get FreeBSD into a state where this is easy. Are patches acceptable for the FreeBSD project that alter > system programs such that > o global variables are moved into context structures, Provided that the code remains readable I think these would be fine. > o constant global variables are declared as "const", and > o variables and functions are declared as "static" if possible? There has been a lot of work on this area. Your patch surprises me because I see many changes which were already done. We would absolutely be interested in such patches > Attached is a patch for the ROUTE(8) program to give an example. This patch can not apply for instance patchfile: 960 961 -char metricnames[] = 962 +static const char metricnames[] = 963 "\011weight\010rttvar\7rtt\6ssthresh\5sendpipe\4recvpipe\3expire" 964 "\1mtu"; but actual file: 1557 static const char metricnames[] = 1558 "\011weight\010rttvar\7rtt\6ssthresh\5sendpipe\4recvpipe\3expire" 1559 "\1mtu"; If you can generate patches against HEAD that would be great. I notice you use git: try to generate patches against https://github.com/freebsd/freebsd -- Eitan Adler
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxgn4bLJ1VQp-_ucoqVm9SJEmo8=sH49k7HxJO3Y9JRZcww>