Is this LOST??

2004-05-01 Thread Deng XueFeng
I found the htonl implemention in libc for i386 is not sync with the
kern.

sys use bswap for swaping the int. but libc still use xchg.
IS THIS LOST?

Here is the patches.
CUT HERE
--- /usr/src/lib/libc/i386/net/htonl.S.orig Sun May  2 12:13:13 2004
+++ /usr/src/lib/libc/i386/net/htonl.S  Sun May  2 12:22:02 2004
@@ -46,7 +46,5 @@
 .set CNAME(htonl),CNAME(__htonl)
 ENTRY(__htonl)
movl4(%esp),%eax
-   xchgb   %al,%ah
-   roll$16,%eax
-   xchgb   %al,%ah
+   bswap   %eax
ret
-END HERE--
CUT HERE
--- /usr/src/lib/libc/i386/net/ntohl.S.orig Sun May  2 12:13:21 2004
+++ /usr/src/lib/libc/i386/net/ntohl.S  Sun May  2 12:19:16 2004
@@ -46,7 +46,5 @@
 .set CNAME(ntohl),CNAME(__ntohl)
 ENTRY(__ntohl)
movl4(%esp),%eax
-   xchgb   %al,%ah
-   roll$16,%eax
-   xchgb   %al,%ah
+   bswap   %eax
ret
-END HERE--


Sincerely,
Deng XueFeng


htonl.S.diff
Description: Binary data


ntohl.S.diff
Description: Binary data
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: kmem_malloc crashes running FreeBSD 5.2.1-RELEASE-p5

2004-05-01 Thread Stefan Bethke
Am 29.04.2004 um 02:01 schrieb Kris Kennaway:

On Wed, Apr 28, 2004 at 02:40:38PM -0700, John Uhlig wrote:
On the web, freebsd mailing lists and bug lists, I have seen existing  
thread about "kmem_malloc and kmem_map too small" problems - but no  
evidence of a fix or patch. We experienced the same problem running  
4.9 but were able to fix it by setting the MAXMEM option in our  
kernel conf file to a value 1GB less than actual physical memory  
size. This does not help with 5.2.1-RELEASE-p5.

See PR 53416.  You just need to tune your kernel resource allocation
to deal with the large amount of memory your system has.
I recently enquired about advice for this exact situation on -current  
(see  
http://lists.freebsd.org/pipermail/freebsd-current/2004-April/ 
026065.html), but didn't really get any.

The PR does not give advice on which parameters in which way, or list a  
solution. My own experimentation has been inconclusive; the machine  
still panics when running the daily scripts. I'm running a cron job  
every minute to record various vm statistics now; hopefully this will  
give me further pointers.

How does PAE affect this? My box has 6 GB, but I have disabled PAE for  
the moment.

And just for clarification: the panic is with basically no load, just  
some file system pressure (two jails running the daily scripts);  
otherwise, the machine is unused.

Stefan

--
Stefan Bethke <[EMAIL PROTECTED]>   Fon +49 170 346 0140
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Squid, SquidGuard, FreeBSD

2004-05-01 Thread Freddie Cash
> Has any one successfully done squid with squidGuard on a FreeBSD
> later then 4.5 ? I have made it work on 4.5 but nothing later
> because of the berkly db changes after 4.5, if you have made
> contentent filtering work on FreeBSD-current can I get some tips? I
> like 4.5 but 4.9 has better hardware coverage.

Is SquidGuard still limited to only filtering the URL of the requested
page, or does it actually check the text content of the page?

Have you considered DansGuardian (www/dansguardian*)?  It has the same
URL filtering abilities of SG, but also includes support for filtering
based on client username, client IP, webserver IP, domain, URL, text
content, weighted text content, file extension, MIME-type, and PICS 
rating.  No hard numbers for the current 2.6 and 2.7 versions, but DG
2.2 and 2.4 were several times faster than SquidGuard (whichever
version was out then) for URL processing.

Just something to consider.  Not sure what your needs or requirements
are, but thought I'd offer up an alternative.  :)

PS: If you decide to install the Dansguardian port(s), there's an
issue with dansguardian-devel where it doesn't install a complete
startup shell script.  You'll have to edit that manually (not sure how
that one got past my tests).

--
Freddie Cash
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: lseek to EOF always 0 for devices

2004-05-01 Thread Dimitry Andric
On 2004-05-01 at 13:37:04 Jens Schweikhardt wrote:

> I'm not sure if I'm trying something impossible here. I want to find the
> size in bytes of a disk special device, eg /dev/da0, /dev/da0s1,
> /dev/da0s1a, /dev/vinum/usr and so on.

I have no idea why lseek'ing in the devices doesn't work, but try
using ioctl(2) with DIOCGMEDIASIZE (from ), this works
fine for me:

#include 
#include 
#include 
#include 

int main (int argc, char **argv)
{
int fd;
off_t len;

if (argc != 2)
return 1;

if ((fd = open (argv[1], O_RDONLY)) < 0) {
perror (argv[1]);
return 1;
}

if (ioctl (fd, DIOCGMEDIASIZE, &len) == -1) {
perror ("DIOCGMEDIASIZE");
return 1;
}

printf ("%lld\n", (long long)len);

close (fd);
return 0;
}


pgp0.pgp
Description: PGP signature


linking questions (how to use linux version of libc)

2004-05-01 Thread Richard Bradley
Hi,

I am trying to compile a program that uses "initstate_r" from random(3) in 
libc.

However this function only seems to exist in the linux version of libc.

Compare `man 3 random` on a linux box [1] which has "initstate_r" and 
"initstate", whereas `man 3 random` on a FreeBSD box [2] has only 
"initstate".

I have the linux compat stuff on my system.

The header called in the file is "#include "

When I try to compile, it comes up with "undeclared identifier" errors.

What can I do?

Any help is much appreciated.


Rich


[1] -- man 3 random on linux -- http://h30097.www3.hp.com/docs/base_doc/
DOCUMENTATION/V51B_HTML/MAN/MAN3/2370.HTM 

[2] -- man 3 random on FreeBSD -- http://www.FreeBSD.org/cgi/
man.cgi?query=random&apropos=0&sektion=0&manpath=FreeBSD+5.2-RELEASE+and
+Ports&format=html

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Squid, SquidGuard, FreeBSD

2004-05-01 Thread Thomas-Martin Seck
* Ed Stover <[EMAIL PROTECTED]> [gmane.os.freebsd.devel.hackers]:

> Has any one successfully done squid with squidGuard on a FreeBSD later then
> 4.5 ? I have made it work on 4.5 but nothing later because of the berkly db
> changes after 4.5, if you have made contentent filtering work on
> FreeBSD-current can I get some tips? I like 4.5 but 4.9 has better hardware
> coverage.

squid and squidGuard work flawlessly on -STABLE if you don't mind that
squidGuard (nowadays?) needs db3 from ports.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Accessing (the i4b) device driver

2004-05-01 Thread Andrew Gordon
On Fri, 30 Apr 2004, Martin Moeller wrote:
>
> I'm totally new to FreeBSD programming, so please forgive my troll-like
> question! I'd like to write a nifty little program showing if somebody is
> calling me via an ISDN line. In the far future, the program should show the
> caller's telephone number.

The easiest way to do this is to use isdnd's regular expression feature,
which allows a program to be run whenever the regular expression matches
an line in the isdnd logging output.  The program that gets run is
typically a shell script, but can be any kind of program that you care to
write.   See the 'regexpr' and 'regprog' keywords on the isdnd.rc(5)
manpage.

That assumes your program just wants to monitor things passively; if you
want it to do handle calls actively, you want full entry in isdnd.rc (see
the 'I4BTEL' example in /etc/isdnd/isdnd.rc.sample).

> Could you please point me to some documentation that is helpful? Nothing in
> the FBSD developer/architecture handbook was able to enlighten me.

http://people.freebsd.org/~hm/i4b-home/documentation.html
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Vendors of multi-port PCI ethernet cards?

2004-05-01 Thread J.-P. Klodzinski
Christian Brueffer wrote:

On Mon, Apr 26, 2004 at 01:46:48PM -0500, Stephen Hocking wrote:
 

All,

Does anyone know where I can lay my hands on one of those 4 port ethernet 
cards that used to be around a while back?

   

Adaptec sells the ANA-64044LV, a 4 port card.  I'm running the 2 port
version of the old revision here, which performs well.  

- Christian

 

I'm very sorry that i don't know the name of the card, but on of my good 
friends is running a dlink! So just look on the homepage of them, or use 
the big eb*y.!

I've you need more detailed infos i'll gone ask him!

OK?
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


lseek to EOF always 0 for devices

2004-05-01 Thread Jens Schweikhardt
Fellow hackers,

I'm not sure if I'm trying something impossible here. I want to find the
size in bytes of a disk special device, eg /dev/da0, /dev/da0s1,
/dev/da0s1a, /dev/vinum/usr and so on. The following program prints
correct sizes for plain files and directories, but it consistently
prints 0 for block devices. If this is not supported, how would I find
the number of blocks for a given block device? I don't want to mess with
parsing disklabels and vinum configs...

#include 
#include 
#include 

int main (int argc, char **argv)
{
int fd;
off_t len;

if (argc != 2)
return 1;

if ((fd = open (argv[1], O_RDONLY)) < 0) {
perror (argv[1]);
return 1;
}

if ((len = lseek (fd, 0, SEEK_END)) == -1) {
perror ("lseek");
return 1;
}

printf ("%lld\n", (long long)len);

close (fd);
return 0;
}


Regards,

Jens
-- 
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"