Linux-Development-Sys Digest #71, Volume #8       Wed, 9 Aug 00 05:13:11 EDT

Contents:
  Re: Ncurses version check (Marco van de Voort)
  Re: Using JNI on Linux (Richard Zidlicky)
  What is the difference between soft link and hard link? (Yi-Hsiu Chou)
  Re: What is the difference between soft link and hard link? (Josef Moellers)
  Re: Linux equivalent for solaris gcore ? (Roberto Congiu)
  Re: Linux equivalent for solaris gcore ? (Kaz Kylheku)
  Re: What is the difference between soft link and hard link? (Moritz Franosch)
  Re: Linux equivalent for solaris gcore ? (Roberto Congiu)
  Re: Linux equivalent for solaris gcore ? (Kaz Kylheku)
  Re: Kernel Panic - SCSI not syncing? (Mario Klebsch)
  Re: Motif ---> Qt (Mario Klebsch)
  Re: Linux equivalent for solaris gcore ? (Tor Arntsen)
  Re: PCI device driver question ([EMAIL PROTECTED])
  Re: Linux equivalent for solaris gcore ? (Nix)
  Re: Using JNI on Linux (Michael M. Welch)
  Re: Linux equivalent for solaris gcore ? (Thomas Steffen)

----------------------------------------------------------------------------

From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: Ncurses version check
Date: 8 Aug 2000 09:19:51 GMT

In article <8moi9l$nq4$[EMAIL PROTECTED]>, Thomas Dickey wrote:
>Marco van de Voort <[EMAIL PROTECTED]> wrote:
>
>> But with a foreign compiler you can't use headers on the target system,
>> which is the problem I'm facing.
>> I believe the hack involves checking the value of the struct. At one
>> place it is a pointer or a character. So if the value isn't <$90 it is NC 4
>> and otherwise NC 5.
>
>I'm curious how you are extracting the headers without using a C compiler
>to do the checking

Just do a straight port of the C headers of 4. Define some alternate types
for both versions.
Then check runtime in some way what version you are dealing with.

All access to structures/functions that are different in different versions
are only accessable via wrapper procedures.

> - it's trivial with a compiler check (using sizeof),
>and doesn't require looking at the resulting data.

However writing a C compiler to do that isn't :-)

But this is only temporarily. We plan some configure system, to tackle these
problems, maybe in cooperation with autoconf.



------------------------------

From: [EMAIL PROTECTED] (Richard Zidlicky)
Crossposted-To: comp.lang.java.programmer,comp.lang.java.help
Subject: Re: Using JNI on Linux
Date: 8 Aug 2000 12:57:24 GMT

In <8mffc5$m44$[EMAIL PROTECTED]> [EMAIL PROTECTED] (Michael M. Welch) writes:


>     Trust me, I've checked, re-checked and re-checked again the
>LD_LIBRARY_PATH.  I narrowed it down by keeping everything in the
>current directory and taking Java out of the equation.  I created
>a Test.cxx file that required the loading of the same shared 
>library in order to link.  I verified that this C++ program would 
>only run with LD_LIBRARY_PATH including the current directory.  
>Even when that program runs correctly, my Java program still 
>cannot load this very same library in this very same directory.

did you try to strace it? RUn in a debugger?

Bye
Richard

------------------------------

From: [EMAIL PROTECTED] (Yi-Hsiu Chou)
Subject: What is the difference between soft link and hard link?
Date: 8 Aug 2000 14:49:21 GMT

Hi..
   I want to know what is the difference between soft link and 
hard , and if they will use inode ?
   Where are the documents about this?
   Thanks a lot.

--
Yi-Hsiu Chou   <mail to: [EMAIL PROTECTED]>
Department of Computer & Information Science
National Chiao-Tung University                            
Hsinchu, Taiwan, R.O.C.

------------------------------

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: What is the difference between soft link and hard link?
Date: Tue, 08 Aug 2000 17:12:34 +0200

Yi-Hsiu Chou wrote:
> =

> Hi..
>    I want to know what is the difference between soft link and
> hard , and if they will use inode ?

A soft link is a file which contains a pathname which will be used to
further search for the file.
A hard link is just an additional name for the same inode.

Therefore a soft link can cross filesystem boundaries and reference a
directory while a hard link cannot.
A soft link may point into nirwana, i.e. you can either set up a
softlink to point to a non-existant file or you can delete the file
without removing the soft link while a hard link will just increase the
link count of the file and you can only delete a file by removing all
hard links that reference it.

As for inodes: a soft link uses two inodes (one for the soft link and
another one for the file actually referenced) while a hard link will
only use one.

>    Where are the documents about this?

Some elementary books about Linux will describe the differences. Soft
links have been around for quite a while. IIRC they were introduced in
4.2bsd.

>    Thanks a lot.

Hope this helps.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)

------------------------------

From: Roberto Congiu <[EMAIL PROTECTED]>
Subject: Re: Linux equivalent for solaris gcore ?
Date: Tue, 08 Aug 2000 09:45:25 -0700

Erik de Castro Lopo wrote:

> Roberto Congiu wrote:
> >
> > Erik de Castro Lopo wrote:
> >
> > > Roberto Congiu wrote:
> > > >
> > > > Hi!
> > > > I was wondering if there's a way to do what solaris gcore command
> > > > does...
> > > > and what it does is to dump the core of a given process (it must be
> > > > stopped with a
> > > > stop signal ).
> > > > it would be very useful to look at faulty CGI scripts that eat a lot of
> > > > CPU time
> > > > (it was what I've been trying to do a couple of days ago).
> > > > Gene Spafford in the Linux Security tutorial at the Open Source
> > > > convention talked about how
> > > > they were using gcore to dump an hacker's session to read its command
> > > > history
> > > > and see what he did.
> > > > I know how to core dump my processes...but as a superuser, how can I
> > > > core dump
> > > > processes that I didn't launch ?
> > >
> > > How about killing the process by sending it a SIGFPE (floating point
> > > exception)?
> > >
> > > kill -8 <process id>
> > >
> >
> > let's say the process to kill is an http process, owned by nobody.
> > Where does linux dump the core ?
> > I kill the process, but I cannot find the core file.
>
> man find?
>
> From the / directory do:
>
> find . - name core -type f -print

I know find - by the way no space between the dash and 'name'.

But:

1) it's not a good idea to run find on a system with

a filesystem of 50 GB

2) I'm not even sure the process dumps the core!

find was the fery first thing I tried but the core of the process I just killed

was not among the cores I found.

--
==========================================
Roberto Congiu
        Alchemy Communications
                LA California USA




------------------------------

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Linux equivalent for solaris gcore ?
Reply-To: [EMAIL PROTECTED]
Date: Tue, 08 Aug 2000 16:57:38 GMT

On Mon, 07 Aug 2000 11:15:01 -0700, Roberto Congiu <[EMAIL PROTECTED]> wrote:
>Hi!
>I was wondering if there's a way to do what solaris gcore command
>does...
>and what it does is to dump the core of a given process (it must be
>stopped with a
>stop signal ).

This has been a UNIX feature for ages. You simply send the SIGQUIT signal to a
process and it dumps.  There is even a way for the tty driver to generate this
signal based on an input character; typically this action is mapped to the
ctrl-\ key.

Of course, this method also causes the process to die. If want to get the core
without stopping the process, you can hack the kernel so that, for example,
do_exit() is not called on SIGQUIT. See the arch/*/kernel/signal.c source
file.

-- 
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.

------------------------------

From: Moritz Franosch <[EMAIL PROTECTED]>
Subject: Re: What is the difference between soft link and hard link?
Date: 08 Aug 2000 20:57:44 +0200




[EMAIL PROTECTED] (Yi-Hsiu Chou) writes:

>    Where are the documents about this?

info libc -> File System Interface

info fileutils -> Special file types -> ln invocation


Moritz

------------------------------

From: Roberto Congiu <[EMAIL PROTECTED]>
Subject: Re: Linux equivalent for solaris gcore ?
Date: Tue, 08 Aug 2000 12:03:13 -0700

Kaz Kylheku wrote:

> On Mon, 07 Aug 2000 11:15:01 -0700, Roberto Congiu <[EMAIL PROTECTED]> wrote:
> >Hi!
> >I was wondering if there's a way to do what solaris gcore command
> >does...
> >and what it does is to dump the core of a given process (it must be
> >stopped with a
> >stop signal ).
>
> This has been a UNIX feature for ages. You simply send the SIGQUIT signal to a
> process and it dumps.  There is even a way for the tty driver to generate this
> signal based on an input character; typically this action is mapped to the
> ctrl-\ key.
>

Yeah, I know it dumps also if you send a SIGSEGV for instance.
My problem is, where can I find the core file produced ?
Is there a way I can have the process dumping to the directory/filename I want ?

Also, the process will not dump if the ulimit  for the core is 0, what's the best
way
to configure the ulimit so the process dumps the core (in a Linux system) ?
/etc/rc.local ?


>
> Of course, this method also causes the process to die. If want to get the core
> without stopping the process, you can hack the kernel so that, for example,
> do_exit() is not called on SIGQUIT. See the arch/*/kernel/signal.c source
> file.

Cool!

But it's ok, I don't care if they die.

Thanks,

Roberto

--
==========================================
Roberto Congiu
        Alchemy Communications
                LA California USA




------------------------------

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Linux equivalent for solaris gcore ?
Reply-To: [EMAIL PROTECTED]
Date: Tue, 08 Aug 2000 19:28:26 GMT

On Tue, 08 Aug 2000 12:03:13 -0700, Roberto Congiu <[EMAIL PROTECTED]> wrote:
>
>Yeah, I know it dumps also if you send a SIGSEGV for instance.
>My problem is, where can I find the core file produced ?

In the current working directory of the process which dumped core.

>Is there a way I can have the process dumping to the directory/filename I want ?

Not without hacking the kernel. Simply have the elf_core_dump function generate
an alternate pathname for core files, like

        /var/corefiles/core.<pid>

easily done with a larger buffer and a sprintf(). ;)

>Also, the process will not dump if the ulimit  for the core is 0, what's the best
>way
>to configure the ulimit so the process dumps the core (in a Linux system) ?
>/etc/rc.local ?

Yes, in general you want to ensure that some ancestor of the process has
set the limits. However, the process can set its own limit back to zero.
So again, you are looking at kernel hacking to override that.


-- 
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.

------------------------------

From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: Kernel Panic - SCSI not syncing?
Date: Tue, 8 Aug 2000 22:44:58 +0200

[EMAIL PROTECTED] (Bakki Kudva) writes:

>Again if this is a tagged-queueing problem can it develop over time?

Software is developed further, and if you do regular system updates,
this program dan develop over time. :-)

I just am getting another thought: About two years ago, I had problems
creeping in silently into an SCSI based system, too. I had system
lockups first once per week, but getting more and mot to several per
day. I had absolutely no idea, what was going wrong, and was preparing
myself to linux kernel debugging.

In the end, it turned out to be a broken SCSI disk. At one point, the
disk had visuable bad sectors (it obviously ran out of spare
sectors). At this point, database recovery failed, and I had to swap
the disk (it still was covered by warranty). The lockups (which I did
not relate to the bad sector problem at that time) were gone with the
new disk and have not reappeared til today.

73, Mario
-- 
Mario Klebsch                                           [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

------------------------------

From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: Motif ---> Qt
Date: Tue, 8 Aug 2000 22:51:23 +0200

[EMAIL PROTECTED] writes:

>can anybody help me porting the Motif's 'XtAppAddInput()' to KDE/Qt ?

Yes, the X toolkit does offer nice functions, doesn't it?

>i am developing an mp3 player based on xaudio and i need it to be a
>KDE program.  Thanks

Have you looked at QDataSource, QDataSink and QAsyncIO? I have not
done much Qt programming (just a little playing around), and an
XtAppAddInput()-replacement was not one of my toys, yet, but it looks
like that's what you are looking for.

73, Mario
-- 
Mario Klebsch                                           [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

------------------------------

From: [EMAIL PROTECTED] (Tor Arntsen)
Subject: Re: Linux equivalent for solaris gcore ?
Date: Tue, 08 Aug 2000 23:29:38 GMT

Roberto Congiu <[EMAIL PROTECTED]> writes:
>Hi!
>I was wondering if there's a way to do what solaris gcore command
>does...
>and what it does is to dump the core of a given process (it must be
>stopped with a
>stop signal ).
[...]

kill -ABRT <pid>
makes the process dump core.


------------------------------

From: [EMAIL PROTECTED]
Subject: Re: PCI device driver question
Date: Tue, 08 Aug 2000 23:41:28 GMT

In article <VcGj5.3714$[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] (Grant Edwards) wrote:
> In article <8mn8fk$m4f$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
>
> >I am writing a PCI device driver for an Intel platform running Red
Hat
> >6.2  The custom PCI card has on-board memory that I can access using
a
> >device driver with the "traditional" open(), release(), read(0 and
> >write() methods.  I am now trying to rewrite the device driver to map
> >the PCI card memory directly to user process space using mmap().  The
> >mmap(0 method uses the PCI card physical address (base_address
> >programmed in the PCI card) and remaps it to the process virtual
address
> >space using remap_page_range() routine.  A pointer is returned in the
> >user space by the mmap() system call (in the user process) which is
the
> >virtaul address representation of the PCI memory.  I see no errors
> >triggered fro the driver up to this point.  However when i try to
access
> >the returned pointer, the system core-dumps with a "bad address"
error.
> >What am I doing wrong?
>
> I've written a demo driver that does the mmap() for PCI
> on-board memory.  You might want to compare:
>
>    ftp://ftp.visi.com/users/grante/stuff/demomm.tar.gz
>

> Grant Edwards                   grante             Yow!  You mean you
don't
>                                   at               want to watch
WRESTLING
>                                visi.com            from ATLANTA?
>
Gentlemen,

Thanks for your help.  Comparing my driver code against your (suggested)
sources, I was convinced it was okay.  So I started looking more closely
at my user process.  Turns out, I had mis-interpreted the meaning of the
page protection flag bits in the mmap system call.  A "cat" of the
process map table showed the device memory mapped without read or write
permissions!  I guess the "bad address" error returned by the program
threw me off the trail.

Anyway, thanks again for your help.


Sent via Deja.com http://www.deja.com/
Before you buy.

------------------------------

From: Nix <$}xinix{[email protected]>
Subject: Re: Linux equivalent for solaris gcore ?
Date: 08 Aug 2000 23:45:09 +0100

Roberto Congiu <[EMAIL PROTECTED]> writes:

> find was the fery first thing I tried but the core of the process I just killed
> was not among the cores I found.

Before you kill it, look at the contents of the fake symlink
/proc/{pid}/cwd. The core should turn up in there.

-- 
`I am of the belief that catnip arrived on the planet in the same spaceship
 that delivered cats. It is the only thing they have from their home
 planet. Tuna, chicken, sparrow-brains, etc., these are all things of our
 world that they like, but catnip is crack from home.' --- Bill Cole

------------------------------

From: [EMAIL PROTECTED] (Michael M. Welch)
Crossposted-To: comp.lang.java.programmer,comp.lang.java.help
Subject: Re: Using JNI on Linux
Date: 9 Aug 2000 05:39:26 GMT

    Thanks VERY much to everyone who chipped in with help.  The problem
was indeed in an improper creation of the shared library due to a VERY
silly mistake on my part.  The Java program was finding the library OK, 
but failing to load it because of that problem.  Thanks especially to 
Robert Lynch who e-mailed me back and forth on Friday to help me figure 
it out.  8-)


- Michael

--
Michael M. Welch
[EMAIL PROTECTED]
http://www.Michael.Welch.net/

------------------------------

From: Thomas Steffen <[EMAIL PROTECTED]>
Subject: Re: Linux equivalent for solaris gcore ?
Date: 09 Aug 2000 09:37:25 +0200

Nix <$}xinix{[email protected]> writes:

> Before you kill it, look at the contents of the fake symlink
> /proc/{pid}/cwd. The core should turn up in there.

Unless of course core dumping is switched of (coredumpsize?) or the
process has no write permission in that directory...

                Thomas
-- 
Internet-Election comming: http://www.democratic-internet.de/

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to