Re: Busybox-1.10.3: ENABLE_FEATURE_TASKSET_FANCY - cpu_set_t undefined

2008-06-17 Thread Denys Vlasenko
On Tuesday 17 June 2008 05:48, [EMAIL PROTECTED] wrote:
 Hi;
   I turn on ENABLE_FEATURE_TASKSET_FANCY and cpu_set_t is
 undefined. Linux kernel source has cpumask_t defined in
 include/linux/cpumask.h. Please advise.

Against which libc (glibc? uclibc? version?) do you build?
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: [RFC] strrstr function in libbb failes on some corner cases

2008-06-17 Thread Bernhard Fischer
On Mon, Jun 16, 2008 at 09:48:07PM +0200, Tito wrote:
On Monday 16 June 2008 09:47:31 Bernhard Fischer wrote:
 On Mon, Jun 16, 2008 at 08:45:18AM +0200, Tito wrote:
 On Monday 16 June 2008 06:33:35 you wrote:

  char* strrstr(const char *haystack, const char *needle)
  {
  char *r = NULL;
  
  if (!needle[0])
  return r;
  while (1) {
  char *p = strstr(haystack, needle);
  if (!p)
  return r;
  r = p;
  haystack = p + 1;

Hi, just for fun, 
one more variant that seems to pass the tests as modified (for )

char* strrstr(const char *haystack, const char *needle)
{
   char *s = NULL;

   while (*haystack) {
   s = (strstr(haystack++, needle)) ? : s;
   }
   return s;
}

but size on my system is the same as Denys' version  :(

scripts/bloat-o-meter busybox_old busybox_unstripped
function old new   delta
strrstr   53  42 -11
--
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-11) Total: -11 bytes

Tito, can you pick one (your decision) and send me the full file
(including your nice testcases)?
TIA and cheers,
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: Busybox-1.10.3: ENABLE_FEATURE_TASKSET_FANCY - cpu_set_t undefined

2008-06-17 Thread walter harms


[EMAIL PROTECTED] wrote:
 Hi;
   I turn on ENABLE_FEATURE_TASKSET_FANCY and cpu_set_t is
 undefined. Linux kernel source has cpumask_t defined in
 include/linux/cpumask.h. Please advise.
 

cpumask_t is not defined in older kernels.

re,
 wh
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: [RFC] strrstr function in libbb failes on some corner cases

2008-06-17 Thread Tito
On Tuesday 17 June 2008 09:43:54 Bernhard Fischer wrote:
 On Mon, Jun 16, 2008 at 09:48:07PM +0200, Tito wrote:
 On Monday 16 June 2008 09:47:31 Bernhard Fischer wrote:
  On Mon, Jun 16, 2008 at 08:45:18AM +0200, Tito wrote:
  On Monday 16 June 2008 06:33:35 you wrote:
 
   char* strrstr(const char *haystack, const char *needle)
   {
   char *r = NULL;
   
   if (!needle[0])
   return r;
   while (1) {
   char *p = strstr(haystack, needle);
   if (!p)
   return r;
   r = p;
   haystack = p + 1;
 
 Hi, just for fun, 
 one more variant that seems to pass the tests as modified (for )
 
 char* strrstr(const char *haystack, const char *needle)
 {
  char *s = NULL;
 
  while (*haystack) {
  s = (strstr(haystack++, needle)) ? : s;
  }
  return s;
 }
 
 but size on my system is the same as Denys' version  :(
 
 scripts/bloat-o-meter busybox_old busybox_unstripped
 function old new   delta
 strrstr   53  42 -11
 --
 (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-11) Total: -11 
 bytes
 
 Tito, can you pick one (your decision) and send me the full file
 (including your nice testcases)?
 TIA and cheers,
 
HI,
Attached you can find a test.c file with both strrstr, mine and Denys', they 
show little
differences on  vs.  test case.
The test cases are improved and checked against the real strstr for consistency.
As you and Denys are more experienced it is up yo you to decide what to do.


Ciao,
Tito
/* vi: set sw=4 ts=4: */
/*
 * Utility routines.
 *
 * Copyright (C) 2008 Bernhard Fischer
 *
 * Licensed under GPLv2 or later, see file License in this tarball for details.
 */

#include string.h
#include stdio.h

#define STRRSTR_TEST
/*#define DENYS*/
/*
 * The strrstr() function finds the last occurrence of th substring needle
 * in the string haystack. The terminating nul characters  are  not compared.
 */
#ifdef DENYS
char* strrstr(const char *haystack, const char *needle)
{
	char *r = NULL;

	if (!needle[0])
			return r;
	while (1) {
			char *p = strstr(haystack, needle);
			if (!p)
	return r;
			r = p;
			haystack = p + 1;
	}
}
#else
char* strrstr(const char *haystack, const char *needle)
{
	char *s = NULL;

	do {
		s = (strstr(haystack, needle)) ? : s;
	} while (*haystack++);
	//printf(%s\n, (s) ? s : NULL);
	return s;
}
#endif

#ifdef STRRSTR_TEST
/* Test */
int main(int argc, char **argv)
{
	int ret = 0;
	int n;
	char *tmp;

	
	ret |= !(n = ((tmp = strrstr(baaabaaab, aaa)) != NULL  strcmp(tmp, aaab) == 0));
	printf('baaabaaab'  vs. 'aaa'   : %s\n, n ? PASSED : FAILED);

	ret |= !(n = ((tmp = strrstr(baaabb, aaa)) != NULL  strcmp(tmp, aaab) == 0));
	printf('baaabb' vs. 'aaa'   : %s\n, n ? PASSED : FAILED);

	ret |= !(n = ((tmp = strrstr(baaabaab, aaa)) != NULL  strcmp(tmp, aaabaab) == 0));
	printf('baaabaab'   vs. 'aaa'   : %s\n, n ? PASSED : FAILED);

	ret |= !(n = (strrstr(aaa, aaa) != NULL));
	printf('aaa'vs. 'aaa'   : %s\n, n ? PASSED : FAILED);

	ret |= !(n = (strrstr(aaa, a) != NULL));
	printf('aaa'vs. 'a' : %s\n, n ? PASSED : FAILED);

	ret |= !(n = (strrstr(aaa, bbb) == NULL));
	printf('aaa'vs. 'bbb'   : %s\n, n ? PASSED : FAILED);

	ret |= !(n = (strrstr(a, aaa) == NULL));
	printf('a'  vs. 'aaa'   : %s\n, n ? PASSED : FAILED);

	ret |= !(n = ((tmp = strrstr(aaa, )) != NULL  strcmp(tmp, aaa) == 0));
	printf('aaa'vs. ''  : %s\n, n ? FAILED : PASSED);

	ret |= !(n = (strrstr(, aaa) == NULL));
	printf(''   vs. 'aaa'   : %s\n, n ? PASSED : FAILED);

	ret |= !(n = ((tmp = strrstr(, )) != NULL  strcmp(tmp, ) == 0));
	printf(''   vs. ''  : %s\n, n ? PASSED : FAILED);

	/*ret |= !(n = (strrstr(NULL, NULL) == NULL));
	printf('NULL'   vs. 'NULL'  : %s\n, n ? PASSED : FAILED);
	ret |= !(n = (strrstr(, NULL) == NULL));
	printf(''   vs. 'NULL'  : %s\n, n ? PASSED : FAILED);
	ret |= !(n = (strrstr(NULL, ) == NULL));
	printf('NULL'   vs. ''  : %s\n, n ? PASSED : FAILED);
	ret |= !(n = (strrstr(aaa, NULL) == NULL));
	printf('aaa'vs. 'NULL'  : %s\n, n ? PASSED : FAILED);
	ret |= !(n = (strrstr(NULL, aaa) == NULL));
	printf('NULL'   vs. 'aaa'   : %s\n, n ? PASSED : FAILED);*/

	return ret;
}
#endif
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: [RFC] strrstr function in libbb failes on some corner cases

2008-06-17 Thread Bernhard Fischer
On Tue, Jun 17, 2008 at 01:52:20PM +0200, Tito wrote:
HI,
Attached you can find a test.c file with both strrstr, mine and Denys', they 
show little
differences on  vs.  test case.
The test cases are improved and checked against the real strstr for 
consistency.

I picked vda's since yours used the non-standard foo?:bar extension.
Thanks!
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: udhcpc in 1.10.3 doesn't like my WLAN card

2008-06-17 Thread Alexander Griesser
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Denys Vlasenko wrote:
| We tried the solution supplied in the topic linked below and it
worked for
| us.
|
| I see nothing linked below. Please let me know what exactly did you try,
| I want to make this fix available to others.

I think he meant linked above and was referring to your advise to
comment out some codelines in clientsocket.c, so yes, it seems as if
commenting out the port check fixes this issue.

Would it make sense to create a config option for this check?

ciao,
- --
Alexander Griesser (Netzwerkadministration)
E-Mail: [EMAIL PROTECTED] | Web: http://www.lkh-vil.or.at
KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach
Tel.:   +43 4242 208 3061 | Fax.:   +43 4242 971 3061
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhXv+oACgkQ66HVD6KUm1o9iQCeOapElGpuMzhb7NgQ/R0AfGRp
AtwAn1u10q10MNPslT6lpCpTUenBIXYq
=kg3V
-END PGP SIGNATURE-
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: udhcpc in 1.10.3 doesn't like my WLAN card

2008-06-17 Thread Denys Vlasenko
On Tuesday 17 June 2008 15:41, Alexander Griesser wrote:
 Denys Vlasenko wrote:
 | I've attached this strace output.
 |
 | Hmmm. Does it help if you delete this code block?
 
 Can't test this at the moment, because I switched to the opensource
 ralink driver which works a treat. But when I get this machine back for

Hmm. It works with one driver but doesn't with another?
Are you sure?
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: udhcpc in 1.10.3 doesn't like my WLAN card

2008-06-17 Thread Denys Vlasenko
On Tuesday 17 June 2008 15:45, Alexander Griesser wrote:
 Denys Vlasenko wrote:
 | We tried the solution supplied in the topic linked below and it
 worked for
 | us.
 |
 | I see nothing linked below. Please let me know what exactly did you try,
 | I want to make this fix available to others.
 
 I think he meant linked above and was referring to your advise to
 comment out some codelines in clientsocket.c, so yes, it seems as if
 commenting out the port check fixes this issue.
 
 Would it make sense to create a config option for this check?

I'd rather disable it for now, but I want someone else to confirm it
independently.
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: udhcpc in 1.10.3 doesn't like my WLAN card

2008-06-17 Thread Alexander Griesser
Denys Vlasenko wrote:
| Can't test this at the moment, because I switched to the opensource
| ralink driver which works a treat. But when I get this machine back for
|
| Hmm. It works with one driver but doesn't with another?
| Are you sure?

Yes, I'm 99,99% sure, at least it was reproducible at that rate.
But as I said, I can do more testing when I get this hardware back at my
desk in a few days hopefully.

ciao,
-- 
Alexander Griesser (Netzwerkadministration)
E-Mail: [EMAIL PROTECTED] | Web: http://www.lkh-vil.or.at
KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach
Tel.:   +43 4242 208 3061 | Fax.:   +43 4242 971 3061
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: MODPROBE: modules.dep with bundled aliases

2008-06-17 Thread Bernhard Fischer
On Tue, Jun 17, 2008 at 03:33:39PM +, Vladimir Dronnikov wrote:
I would go further, Bernhard. Look. I added bundling modules.symbols
to depmod. Modules.dep became beyond 100Kb in size. Parsing it every
time modprobe is invoked is a pain for system. Moreover, we have to
encrypt dependencies and aliases in one place (depmod) and then
decrypt them in the other (modprobe).
I suggest to invent some kind of binary representation of modules.dep
for BB. That way we could get rid of a lot of weird code both in
depmod and in modprobe, shrink them and make them much faster. The
rationale is that a user can edit /etc/modprobe.d/* for customization,
then run depmod to compile binary modules.dep. Since intrinsic
dependencies and aliases are hardly a subject to edit, this sounds
reasonable. I suggest to make in FEATUREd so that one can choose
modules.dep at configuration time.

Would you rephrase the idea in better English and post to the list, Bernhard?

Your english is perfectly fine, let's see what other people think about
the idea.

Yann, vda, ping?

TIA,
--
Vladimir


2008/6/17, Bernhard Fischer [EMAIL PROTECTED]:
 On Mon, Jun 16, 2008 at 12:39:03PM -0700, [EMAIL PROTECTED] wrote:
Hello!

 hi

IMHO it is a fruitful idea to keep all intrinsic module info in just one
 file: modules.dep.
Attached patch frees 300 bytes if we employ this idea.

 Sounds promising.
 I think that p = skip_whitespace(p); is just fine, no?

Could you apply it so I could use vanilla svn version for my system nightly
 build?

 Please send your patch to the list and CC Yann (the modprobe maintainer)
 so he can comment on it.

TIA,

--
Vladimir

P.S. TODO file states we still have no depmod in BB...

 Ah, thanks for the hint, i'll remove it in a minute.
 cheers,

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


MODPROBE: next generation

2008-06-17 Thread dronnikov
0. Intro

depmod + modprobe is some kind of complicated codec.
Though the syntax of modprobe.conf and friends is human-friendly most of module 
dependencies
is intrinsic and are hardly a subject to be customized manually.
du modules.* gives 150Kb on my reasonably small system and this amount of 
loosely defined textual data
must be parsed at every modprobe invocation.

I suggest to invent for BB a custom modules.dep format which bites all above 
issues.

1. Format of modules.dep (draft)

Consider a module X which depends on Y and Z, has aliases X1 and X2 and must be 
loaded with options O1 and O2.
We could write this definition down as follows:

---
X
Y Z
X1 X2
O1 O2
---

If any of parts of definition is missed we use empty line for it.
No more continuation lines, delimiters and so on!
Just mmap() the whole file and count for well-known amount of EOLs for each 
module and use skip_whitespace().
offI wish we had gzmmap() invented (or have we?)/off
Extensions to such a format can be done trivially.

9. Miscellany

depmod can be trivially (IMO) updated to generate new modules.dep
Personally I think of depmod as of something redundant in terms of BB.
modules.dep could be generated on-the-fly during the first call to modprobe if 
it is missed.

To not interfere with old-style modutils new modules.dep should be named, 
say, modules.bb.

Comments?

--
Vladimir
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

[PATCH] fix last corner case in strrstr.c

2008-06-17 Thread Tito
Hi,
current implementation fails to be coherent with real strstr()
on the last test case:
./test
'baaabaaab'  vs. 'aaa'   : PASSED
'baaabb' vs. 'aaa'   : PASSED
'baaabaab'   vs. 'aaa'   : PASSED
'aaa'vs. 'aaa'   : PASSED
'aaa'vs. 'a' : PASSED
'aaa'vs. 'bbb'   : PASSED
'a'  vs. 'aaa'   : PASSED
'aaa'vs. ''  : PASSED
''   vs. 'aaa'   : PASSED
''   vs. ''  : FAILED

this patch fixes this with no size increase:

 ./test
'baaabaaab'  vs. 'aaa'   : PASSED
'baaabb' vs. 'aaa'   : PASSED
'baaabaab'   vs. 'aaa'   : PASSED
'aaa'vs. 'aaa'   : PASSED
'aaa'vs. 'a' : PASSED
'aaa'vs. 'bbb'   : PASSED
'a'  vs. 'aaa'   : PASSED
'aaa'vs. ''  : PASSED
''   vs. 'aaa'   : PASSED
''   vs. ''  : PASSED

./scripts/bloat-o-meter busybox_old busybox_unstripped
function old new   delta
--
(add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes

Function is changed to:

char *strrstr(const char *haystack, const char *needle)
{
char *r = NULL;

do {
char *p = strstr(haystack, needle);
if (p)
r = p;
} while (*haystack++);
return r;
}

The contra is that it is probably a little more cpu intensive :)
Please apply if you like it.

Ciao,
Tito
--- libbb/strrstr_orig.c	2008-06-17 16:11:06.0 +0200
+++ libbb/strrstr.c	2008-06-17 21:33:51.0 +0200
@@ -13,19 +13,16 @@
  * The strrstr() function finds the last occurrence of the substring needle
  * in the string haystack. The terminating nul characters are not compared.
  */
-char* strrstr(const char *haystack, const char *needle)
+char *strrstr(const char *haystack, const char *needle)
 {
 	char *r = NULL;
-
-	if (!needle[0])
-			return r;
-	while (1) {
-			char *p = strstr(haystack, needle);
-			if (!p)
-	return r;
+	
+	do {
+		char *p = strstr(haystack, needle);
+		if (p)
 			r = p;
-			haystack = p + 1;
-	}
+	} while (*haystack++);
+	return r;
 }
 
 #ifdef __DO_STRRSTR_TEST
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox