Re: Ok, that's it, enough is enough! (rpc.lockd)

1999-11-28 Thread Doug Barton

Alfred Perlstein wrote:
> 
> On Mon, 22 Nov 1999, David E. Cross wrote:
> 
> > Ok... I have *had* it with the meta, but not really, lockd.  Are there any
> > kernel issues with correctly implimenting rpc.lockd?   

I can't help with the code, but put me down as both very interested,
and willing to help test. We have a mixed sun, netapp and freebsd nfs
environment, and I have some freebsd machines that I can sacrifice to
the cause. We are pretty desperate for working NFS file locking at work
as well. 

FWIW, we tried the linux version of lockd on linux and not only did it
suck potatoes, it was frequently the cause of that server crashing. I
would stay completely away from it. 

Thanks,

Doug
-- 
"Welcome to the desert of the real." 

- Laurence Fishburne as Morpheus, "The Matrix"


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Fwd: Re: kstat - an API for gathering kernel stats

1999-11-28 Thread Arun Sharma


[ For some reason, this post through muc.lists.freebsd.hackers gateway didn't
  show up on the mailing list. Forwarding it to the mailing list.. ]

On Thu, 04 Nov 1999 20:38:50 -0800, Mike Smith <[EMAIL PROTECTED]> wrote:
> > I don't see any examples in sys/modules. The SYSCTL_INT macros eventually
> > expands to DATA_SET which puts certain data in a different ELF section.
> 
> You don't do anything magic at all; it's handled invisibly by the 
> kernel linker.

I was thinking about implementing SMP cpu stats using sysctl today and
I have a question - can I create sysctl nodes dynamically ?

i.e.

for (cpu = 0; cpu < get_num_cpus(); cpu++) {
/* create sysctl node here ? */
}

Also, one simple solution to maintaining per cpu stats is to put the whole
thing in struct globaldata. All existing code remains unchanged and 
automagically updates the per cpu stats. I may need to add some additional
variables, which reflect system wide data. Now, if I put stuff in globaldata
and try to export it using sysctl, things get a little more complex.

One solution to the above problem is to use SMPpt relative addresses in
the sysctl declarations. But given that the number of CPUs is known only
at runtime, we come back to the first question in this mail.

-Arun
 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Error compiling..

1999-11-28 Thread Ben Smithurst

[EMAIL PROTECTED] wrote:

> Im trying to compile a program and IM getting a errormessage, I have
> included the error message bellow.
> 
> viking# cc emsg1.c 
> emsg1.c: In function `main':
> emsg1.c:197: warning: passing arg 2 of `connect' from incompatible pointer
> type
> /var/tmp/ccRu22801.o: In function `main':
> /var/tmp/ccRu22801.o(.text+0x5bb): undefined reference to `cuserid'
> viking#
> 
> The software IM trying to compile is a network monitoring tool named
> "EMU", I've found it at "http://www.jarrix.com.au".
> 
> At line 197 it looks like this...
> 
> if( connect(s, &sin, sizeof(sin)) < 0) {

Cast the second argument to (struct sockaddr *). i.e.

if (connect(s, (struct sockaddr *)&sin, sizeof sin) < 0) {
...

> And where it complains about the "cuserid" bit it looks like this...
> 
> /* get my user name */
> if (u_flag == 0) {
> cuserid(myuser);
> } 

RTFM. "man cuserid" says:

DESCRIPTION
 The cuserid function is made obsolete by getpwuid.
 It is available from the compatibility library, libcompat.

So you need to add -lcompat to the command line, or take the manual
page's advice and use getpwuid (with an argument of geteuid()) instead,
and copy the pw_name member of the returned structure to myuser.

-- 
Ben Smithurst| PGP: 0x99392F7D
[EMAIL PROTECTED] |   key available from keyservers and
 |   [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Error compiling.. (Again, forgot the attachment)

1999-11-28 Thread Mike Smith

> As regards to your link-time error (missing `cuserid') I'm afraid I
> can't be of any help.

You could read the cuserid(3) manpage, which should tell you enough to 
get yourself sorted out.

-- 
\\ Give a man a fish, and you feed him for a day. \\  Mike Smith
\\ Tell him he should learn how to fish himself,  \\  [EMAIL PROTECTED]
\\ and he'll hate you for a lifetime. \\  [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Error compiling.. (Again, forgot the attachment)

1999-11-28 Thread Kip Macy

cuserid is in the compatibility library, from the man page:
CUSERID(3) FreeBSD Library Functions Manual 
CUSERID(3)

NAME
 cuserid - get user name associated with effective UID

SYNOPSIS
 #include 

 char *
 cuserid(char *s)

DESCRIPTION
 The cuserid function is made obsolete by getpwuid.
 It is available from the compatibility library, libcompat.


To get the program to link just add:

-lcompat



On Sun, 28 Nov 1999, Ronald F. Guilmette wrote:

> 
> In message <[EMAIL PROTECTED]>, you wrot
> e:
> 
> >Hi everyone...
> >
> >First of all I would like to state that IM not a programmer.
> 
> Then you're probably not a `hacker' either.
> 
> >Im trying to compile a program and IM getting a errormessage, I have
> >included the error message bellow.
> >
> >viking# cc emsg1.c 
> >emsg1.c: In function `main':
> >emsg1.c:197: warning: passing arg 2 of `connect' from incompatible pointer
> >type
> >/var/tmp/ccRu22801.o: In function `main':
> >/var/tmp/ccRu22801.o(.text+0x5bb): undefined reference to `cuserid'
> >viking#
> >
> >The software IM trying to compile is a network monitoring tool named
> >"EMU", I've found it at "http://www.jarrix.com.au".
> >
> >At line 197 it looks like this...
> >
> >if( connect(s, &sin, sizeof(sin)) < 0) {
> 
> Try replacing that line with:
> 
>  if( connect(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
> 
> That should fix your `incompatable pointer' warning.
> 
> As regards to your link-time error (missing `cuserid') I'm afraid I
> can't be of any help.
> 
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
> 
> 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Error compiling.. (Again, forgot the attachment)

1999-11-28 Thread Ronald F. Guilmette


In message <[EMAIL PROTECTED]>, you wrot
e:

>Hi everyone...
>
>First of all I would like to state that IM not a programmer.

Then you're probably not a `hacker' either.

>Im trying to compile a program and IM getting a errormessage, I have
>included the error message bellow.
>
>viking# cc emsg1.c 
>emsg1.c: In function `main':
>emsg1.c:197: warning: passing arg 2 of `connect' from incompatible pointer
>type
>/var/tmp/ccRu22801.o: In function `main':
>/var/tmp/ccRu22801.o(.text+0x5bb): undefined reference to `cuserid'
>viking#
>
>The software IM trying to compile is a network monitoring tool named
>"EMU", I've found it at "http://www.jarrix.com.au".
>
>At line 197 it looks like this...
>
>if( connect(s, &sin, sizeof(sin)) < 0) {

Try replacing that line with:

 if( connect(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) {

That should fix your `incompatable pointer' warning.

As regards to your link-time error (missing `cuserid') I'm afraid I
can't be of any help.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Error compiling.. (Again, forgot the attachment)

1999-11-28 Thread patrik

Sorry for the double posting...

Regards
Patrik Astrom


-- Forwarded message --
Date: Sun, 28 Nov 1999 22:59:29 +0100 (CET)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Error compiling..

Hi everyone...

First of all I would like to state that IM not a programmer.

Im trying to compile a program and IM getting a errormessage, I have
included the error message bellow.

viking# cc emsg1.c 
emsg1.c: In function `main':
emsg1.c:197: warning: passing arg 2 of `connect' from incompatible pointer
type
/var/tmp/ccRu22801.o: In function `main':
/var/tmp/ccRu22801.o(.text+0x5bb): undefined reference to `cuserid'
viking#

The software IM trying to compile is a network monitoring tool named
"EMU", I've found it at "http://www.jarrix.com.au".

At line 197 it looks like this...

if( connect(s, &sin, sizeof(sin)) < 0) {
close(s);
sleep(rand[count]);
count++;
}
else { 
send(s, msg, strlen(msg), 0);
if(q_option) { 
fp = fdopen(s, "r"); 
while ((c = fgetc(fp)) != EOF) {
putchar(c);
}
close(s);
exit(0);
}
close(s);
exit(0);
}


And where it complains about the "cuserid" bit it looks like this...

/* get my user name */
if (u_flag == 0) {
cuserid(myuser);
} 

As stated above IM not a programmer and I would be most grateful for any
hints or suggestions.

Im attaching the emsg1.c file to if someone should get intressted.

Regards 
Patrik Astrom



/* emsg.c - send log messages to the EMU event manager
   VERSION 1.1
#  Copyright 1999
#  by Jarrix Systems Pty Ltd.  All rights reserved.  Some individual
#  files in this distribution may be covered
#  by other copyrights, as noted in their embedded comments.
#
#  Redistribution and use in source and binary forms are permitted
#  provided that this entire copyright notice is duplicated in all such
#  copies, and that any documentation, announcements, and other
#  materials related to such distribution and use acknowledge that the
#  software was developed at Jarrix Systems Pty Ltd by Jarra and Anna
#  Voleynik.
#
#  No charge, other than an "at-cost" distribution fee, may be charged
#  for copies, derivations, or distributions of this material without
#  the express written consent of the copyright holder.
#
#  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY
#  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR
#  PURPOSE.


 */

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

extern int errno;

#define ARGS "o:h:u:n:p:m:t:w:s:c:"

main(argc,argv)
int argc;
char **argv;
{
int c;
FILE *fp;
char hostname[65];
char myhost[65];
char myuser[25];
char type[25];
char ttl[13]="none";
int port;
int s;
int ret;
time_t t;
char mtime[13];
char severity[13]="none";
char class[129]="none";
char password[25];
char message[257];
char msg[1024];
int rand[7]={3,6,9,12,15,18,21};
struct hostent *hp;
struct sockaddr_in sin;
extern char *optarg;
extern int optind;
int errflg=0;
int count=0;
int h_flag=0;
int u_flag=0;
int o_flag=0;
int n_flag=0;
int p_flag=0;
int t_flag=0;
int w_flag=0;
int s_flag=0;
int m_flag=0;
int c_flag=0;
int q_option=0;
struct tm *mytime;


optarg = NULL;

while (!errflg && (c = getopt(argc, argv, ARGS)) != EOF)
   switch (c) {
   case 'n':
n_flag = 1;
   strcpy(hostname,optarg);
   break;
   case 'p':
p_flag = 1;
   port = atoi(optarg);
   break;
   case 't':
t_flag = 1;
   strcpy(ttl,optarg);
   break;
   case 'w':
w_flag = 1;
   strcpy(password,optarg);
   break;
   case 'm':
 

Error compiling..

1999-11-28 Thread patrik

Hi everyone...

First of all I would like to state that IM not a programmer.

Im trying to compile a program and IM getting a errormessage, I have
included the error message bellow.

viking# cc emsg1.c 
emsg1.c: In function `main':
emsg1.c:197: warning: passing arg 2 of `connect' from incompatible pointer
type
/var/tmp/ccRu22801.o: In function `main':
/var/tmp/ccRu22801.o(.text+0x5bb): undefined reference to `cuserid'
viking#

The software IM trying to compile is a network monitoring tool named
"EMU", I've found it at "http://www.jarrix.com.au".

At line 197 it looks like this...

if( connect(s, &sin, sizeof(sin)) < 0) {
close(s);
sleep(rand[count]);
count++;
}
else { 
send(s, msg, strlen(msg), 0);
if(q_option) { 
fp = fdopen(s, "r"); 
while ((c = fgetc(fp)) != EOF) {
putchar(c);
}
close(s);
exit(0);
}
close(s);
exit(0);
}


And where it complains about the "cuserid" bit it looks like this...

/* get my user name */
if (u_flag == 0) {
cuserid(myuser);
} 

As stated above IM not a programmer and I would be most grateful for any
hints or suggestions.

Im attaching the emsg1.c file to if someone should get intressted.

Regards 
Patrik Astrom



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



cdrom speed adjustment ioctl

1999-11-28 Thread Egervary Gergely

hello,

I've just hacked a new ioctl into the ATAPI cdrom driver, which
lets the user to specify (pronounce: ``slow down'' :) the speed 
of todays' extremely high speed drives.

It's a documented ATAPI feature, and is very easy to implement,
and I've found it very useful :)

first, you need to add the ioctl into sys/cdio.h:


struct ioc_spdsel
{
int rate;
}

#define CDIOCSPDSEL _IOW('c',32,struct ioc_spdsel)


second, need to add this into i386/isa/atapi.h


#define ATAPI_SPEED_SELECT  0xbb


and finally need to add this case into the function ``acdioctl'' in 
i386/isa/atapi-cd.c


case CDIOCSPDSEL:
{
struct ioc_spdsel *arg = (struct ioc_spdsel *)addr;

return acd_request_wait(cdp, ATAPI_SPEED_SELECT, 0,
arg->rate>>8 & 0xff,
arg->rate & 0xff,
0, 0, 0, 0, 0, 0, 0, 0);
}


of course unified diff's are available. i'm not an experienced
kernel hacker, please feel free to correct me and drop me
a mail about this thingy...

thanks in advance

-- mauzi

Gergely EGERVARY
[EMAIL PROTECTED]



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Test code...

1999-11-28 Thread Kris Kennaway

On Sat, 27 Nov 1999, Brian J. McGovern wrote:

> Anyone have any suggestions (or feel like writing) code to exercise the
> following subsystems?
> 
>   - Virtual Memory
> 
>   - The threads library
> 
>   - mmap() and friends
> 
> We want to try to bang on them a little more for 3.4 than we have in the past.

Search the PR database and the mailing list archives for regression tests
(things which at one time used to break things, but which are claimed to
have been fixed). There are quite a few of these, although some bugs have
only been fixed in -current because of the intrusive nature of the
required changes.

Kris


Just remember, as you celebrate Thanksgiving with your family feasts of
turkey, cranberries, stuffing, gravy, mashed potatoes, squash, corn,
cornbread, apples, pickles, dumplings, fish, orangutans, fruitbats,
breakfast cereals, and so forth, to keep in mind the true reason for the
season: The birth of Santa.



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message