Linux-Development-Apps Digest #390, Volume #6     Wed, 1 Mar 00 16:13:18 EST

Contents:
  Re: strupr for Linux? ("Chris Severn")
  Re: Problem with GTK (Bruno Barberi Gnecco)
  ANN: POSIX and Single UNIX Spec V3 draft 3 now available (Andrew Josey)
  dbm / ndbm use ("Rafael García")
  Re: [q]glibc rpm upgrade failure? ([EMAIL PROTECTED])
  Commercial ("tulane")
  Re: Help: can't link my X program in linux (John Miskinis)
  newbie error making my rpm-package (Bjorn Beheydt)
  Re: Struct size and allocate problem! need help. (Bernd Strieder)
  Re: 3DSMAX 4 Linux ??? ("Dominic Laflamme")
  Re: strupr for Linux? (Mattias Engdegård)
  Re: strupr for Linux? (Mattias Engdegård)
  Electric Fence for C++ ??? (Anes Lihovac)
  Re: Electric Fence for C++ ??? (Kaz Kylheku)
  Re: Electric Fence for C++ ??? (Tom Glass)
  Re: clone threads ... (Chris)
  Re: pthreads - shared memory (Dixon Ly)
  Re: dbm / ndbm use (Chris)
  Date bugs in glibc? (Aaron Bentley)
  Re: Struct size and allocate problem! need help. (Kevin Smith)
  Re: Semaphore quustion ... part 2!! Bug ? ("Lawrence K. Chen, P.Eng.")

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

From: "Chris Severn" <[EMAIL PROTECTED]>
Subject: Re: strupr for Linux?
Date: Wed, 1 Mar 2000 18:34:58 +0800


Erik de Castro Lopo wrote in message <[EMAIL PROTECTED]>...

[snip body of message - concentrate on .sig]

>+-------------------------------------------------+
>     Erik de Castro Lopo     [EMAIL PROTECTED]
>+-------------------------------------------------+
>From Time magazine, "Numbers" section:
> $5 million:  Estimated annual cost for a 10-year program that
>              would identify large asteroids most threatening
>              to earth.
> $75 million: Budget for "Deep Impact", a film about the
>              devastation caused when a comet hits earth.

That's pretty funny.  Have they got the funding they need yet ?

I'd gladly donate 1/15th of the price of a movie ticket each year if it
helped the chances of earth not getting hit by an asteroid - for me, my
children, my childrens children..........

Hell, put me down for 2/15ths - get them searching for a planet made out of
chocolate while they're at it.

And, 3/15ths if they can prove that Jupiter's satellite Europa isn't liquid
water below its icy crust - but 10 million year old scotch.

Chris Severn
--
Delete the 'x' to remove the spamblock.
Except spammers, for whom my email address is abuse@localhost



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

From: Bruno Barberi Gnecco <[EMAIL PROTECTED]>
Subject: Re: Problem with GTK
Date: 1 Mar 2000 05:37:13 -0600
Reply-To: [EMAIL PROTECTED]

Aravind wrote:

>         I am trying to set up gtk on my linux (debian) machine. I can't
> get it to compile even the first program. I get the following message
> ---------------------------------------------------------------------
> ~/prog/cpp/gui/gtk $gcc base.c -o base `gtk-config --cflags --libs`
> /usr/lib/libdl.a(dlsym.o): In function `doit.2':

        Your problem is in libdl.

> -----------------------------------------------------------------------
> ~ $gtk-config --libs
> -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl
> -lXi -lXext -lX11 -lm
> ~ $

        As -ldl is invoked, the dl library is used, and apparently you have
some problems with it. Try running ldconfig or reinstalling libdl.

-- 
Bruno Barberi Gnecco <[EMAIL PROTECTED]>
http://www.geocities.com/RodeoDrive/1980/
Quoth the Raven, "Nevermore". - Poe

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

From: Andrew Josey <[EMAIL PROTECTED]>
Subject: ANN: POSIX and Single UNIX Spec V3 draft 3 now available
Crossposted-To: 
comp.std.misc,comp.os.linux.development.system,gnu.misc.discuss,comp.unix.programmer,comp.programming.threads,comp.realtime
Date: Wed, 01 Mar 2000 12:18:09 GMT

Draft 3 of the joint revision to POSIX and the Single UNIX Specification V3
is now available for review. To join the review group and download the
specifications see http://www.opengroup.org/austin/ (The Austin Group
web site). The new  draft merges XNS5.2, 1003.1d, 1003.1j,  1003.1a,
1003.2b and 1003.2d (sockets, advanced/additional realtime, threads,
symlinks for utilities etc).

-- 
Andrew Josey, #include <disclaimer.h> 
Austin Group Chair, The Open Group.
http://www.unix-systems.org

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

From: "Rafael García" <[EMAIL PROTECTED]>
Subject: dbm / ndbm use
Date: Wed, 1 Mar 2000 14:42:55 +0100

Hello all

Can anybody tell me what can you do with DBM library systems?
I need to make a database where to store keys in any order, and then get
them by a range. For example, I get this data:

1524879 : 378-4983943
5878729 : 378-3987283
2210192 : 375-9389209
7603898 : 378-9839029
....

And at any moment (perhaps during new insertions) another proccess needs to
read all keys between 200000
and 300000. It seems I could use dbm/ndbm except I cannot get a set of
records: I have to start reading at the first key.

Is there a standard library for this kind of work?
I think this is so common in computing that it must be generalized like you
can sort an in-memory array with qsort().

I don't want a big database system because I need a simple program to do the
job. It would be nice to have a  module in C or a library to manage a b-tree
file structure so I can embed it in my c program.

Thanks




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

From: [EMAIL PROTECTED]
Subject: Re: [q]glibc rpm upgrade failure?
Date: Wed, 01 Mar 2000 14:16:14 GMT

In article <89etdj$kdu$[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:
> Am I the only one having troubles upgrading glibc 2.1.[12] to 2.1.3
> with rpm? Two scenarios fail:
>
> 1. Mandrake 7.0 glibc rpms (glibc-2.1.2-9mdk) upgrading with Mandrake
> glibc-2.1.3-0.1mdk.rpm and I get tons of conflicts like this:
>
> file /lib/ld-linux.so.2 from install of glibc-2.1.3-0.1mdk conflicts
> with file f
> rom package glibc-2.1.2-9mdk
> file /lib/libBrokenLocale.so.1 from install of glibc-2.1.3-0.1mdk
> conflicts with
>  file from package glibc-2.1.2-9mdk
>
> I have a Redhat 6.0 system with the latest glibc rpm (glibc-2.1.1-7.6
> from VALinux) and the new RedHat latest glibc rpm (glibc-2.1.3-
> 8.i386.rpm) and this gives me conflicts like:
>
> file /usr/lib/gconv/IBM277.so from install of glibc-2.1.3-8 conflicts
> with file
> from package glibc-2.1.1-7.6
> file /usr/lib/gconv/IBM278.so from install of glibc-2.1.3-8 conflicts
> with file
> from package glibc-2.1.1-7.6
>
> What do I need to do to make this work? Has anyone been able to make
> this work?

I just spent the last two days reading about this migration. I haven't
done it yet. But might these files ome from a previous failed
installation of the glibc? If so do a rpm uninstall first.

hope it helps
Irgei


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

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

From: "tulane" <[EMAIL PROTECTED]>
Subject: Commercial
Date: Wed, 1 Mar 2000 08:35:02 -0600

I'm looking for a site on the web which offers commercial linux software.
I'm also looking for free software to post on my site. If anyone is
interested, please contact me at: [EMAIL PROTECTED]





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

From: John Miskinis <[EMAIL PROTECTED]>
Subject: Re: Help: can't link my X program in linux
Date: Wed, 01 Mar 2000 10:17:17 -0500

>

Hi,

Find out where your libX11.so and libX11.a files are.  Then add
"-Lthat_directory"
before the -lX11....

This will get you going...

If you don't know where the files are use:

find /usr -name "libX11.*" -print

John



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

From: Bjorn Beheydt <[EMAIL PROTECTED]>
Subject: newbie error making my rpm-package
Date: Wed, 01 Mar 2000 15:17:33 GMT

hello all,

I've read the manual on www.rpm.org, and used their spec-file as a
basis. Then I've placed all my files in the appropriate directories and
tried to make the package using "rpm -ba x-wvdial-0.16.spec", but I
always get errors from unknown tags.

I've added the specfile:

   Summary: A graphical frontend to x-wvdial, with some extra features.
    Name: x-wvdial
    Version: 0.16
    Release: 1
    Copyright: GPL
    Group: Applications/Internet
    Source:
    BuildRoot: /var/tmp/%{name}-buildroot

    %description
    A graphical frontend to x-wvdial, with some extra features.

    %prep
    
    %build
    
    %install
    cp $RPM+BUILD_ROOT/x-wvdial /usr/bin/
    echo "Please configure ~/.x-wvdialrc to your needs"
    echo "See README.us in /usr/doc/x-wvdial"
    cp $RPM_BUILD_ROOT/USA/x-wvdial-us.msg /usr/bin/
    cp $RPM_BUILD_ROOT/Dutch/x-wvdial-nl.msg /usr/bin/
    cp $RPM_BUILD_ROOT/German/x-wvdial-de.msg /usr/bin/
    cp $RPM_BUILD_ROOT/Spanish/x-wvdial-se.msg /usr/bin/
    cp $RPM_BUILD_ROOT/USA/x-wvdialrc.us ~/.x-wvdialrc
    mkdir /usr/docs/x-wvdial
    cp $RPM_BUILD_ROOT/USA/README.us /usr/docs/x-wvdial/
    cp $RPM_BUILD_ROOT/German/README.de /usr/docs/x-wvdial/
    cp $RPM_BUILD_ROOT/Dutch/README.nl /usr/docs/x-wvdial/
    cp $RPM_BUILD_ROOT/Spanish/README.se /usr/docs/x-wvdial/

    
   

    %clean
    rm -rf $RPM_BUILD_ROOT

    %files
    %defattr(-,root,root)
    %doc README.us, README.se, README.nl, README.de

    /usr/bin/x-wvdial
    /config
    /usr/doc/x-wvdial/*

    %changelog


==============================================================================
Bjorn Beheydt

New and Improved Homepage: http://www.linuxfreak.com/~borniet
Linux: because it separates the boys from the men.
==============================================================================

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

From: Bernd Strieder <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux,comp.os.linux.development.system,comp.unix.sco.misc,comp.unix.sco.programmer,comp.unix.unixware.misc,tw.bbs.comp.linux
Subject: Re: Struct size and allocate problem! need help.
Date: Wed, 01 Mar 2000 16:40:07 +0100

Jaron wrote:
> 
> Hi,
>     I encounter a compiling program as below:
> 
>     struct    a {
>         unsigned char    a1;
>         unsigned char    a2;
>         unsigned short    a3
>         unsigned short    a4
>         unsigned long    a5;
>     };
> 
> the structure size must be 10 but use sizeof print out is 12...
> I know this is the alignment problem of structure ..
> But how to resolve it ?
> I need to know the compiler option like -xx ?
> do anyone konw about this ?

According to the info files of gcc you can try

struct    a {
  unsigned char    a1;
  unsigned char    a2;
  unsigned short    a3
  unsigned short    a4
  unsigned long    a5;
} __attribute__ ((packed));

This packed attribute is recursively applied to the struct members, so
take care if you have other struct members.

This is something that cannot be solved by compiler options, since this
would hold for all of the structures, ant thus would change the ABI,
preventing you from calling libc functions with structures. If you have
to write portable software, then you will have to look how other
compilers achieve this and work with macros, a la:

#ifdef __GNUC__
#define PACKED_ATTRIBUTE __attribute__ ((packed))
#else
#define PACKED_ATTRIBUTE
#endif

struct    a {
  unsigned char    a1;
  unsigned char    a2;
  unsigned short    a3
  unsigned short    a4
  unsigned long    a5;
} PACKED_ATTRIBUTE;

HTH

Bernd

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

From: "Dominic Laflamme" <[EMAIL PROTECTED]>
Subject: Re: 3DSMAX 4 Linux ???
Date: Wed, 1 Mar 2000 10:43:05 -0500

> > Tunnash wrote...
> >
> > >Can anybody help me to find binaries of 3dsmax for linux ?
> >
> > I didn't even know it exists. Are you sure about that?
> >
> > Rolf Magnus
>
> I tried 3DSMax2.5 on my Linux box using Wine. The drivers lock-files
> were not set and the interface leaved. Maybe someone could have an
> idea??
>

er...try Discreet / Kinetix technical support.





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

From: [EMAIL PROTECTED] (Mattias Engdegård)
Subject: Re: strupr for Linux?
Date: 1 Mar 00 16:01:17 GMT

In <[EMAIL PROTECTED]> Erik de Castro Lopo <[EMAIL PROTECTED]> writes:

>Ron Ahn wrote:

>void strupr (char *str)
>{   while (*str)
>    {
>        *str = toupper (*str) ;

that should be
         *str = toupper((unsigned char *)*str);

>       str ++ ;
>    }
>}


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

From: [EMAIL PROTECTED] (Mattias Engdegård)
Subject: Re: strupr for Linux?
Date: 1 Mar 00 16:13:12 GMT

I wrote:

>>Ron Ahn wrote:

>>void strupr (char *str)
>>{   while (*str)
>>    {
>>        *str = toupper (*str) ;

>that should be
>         *str = toupper((unsigned char *)*str);

Oops, make that
          *str = toupper((unsigned char)*str);
instead. Sorry!

>>      str ++ ;
>>    }
>>}


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

From: Anes Lihovac <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Electric Fence for C++ ???
Date: Wed, 01 Mar 2000 17:42:46 +0100

Hi !

I am searching for a Library which like EFENCE
but for C++ !!!

Any suggestion ???
Thanks
Ciao
Anes

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development.system
Subject: Re: Electric Fence for C++ ???
Reply-To: [EMAIL PROTECTED]
Date: Wed, 01 Mar 2000 16:40:53 GMT

On Wed, 01 Mar 2000 17:42:46 +0100, Anes Lihovac <[EMAIL PROTECTED]> wrote:
>Hi !
>
>I am searching for a Library which like EFENCE
>but for C++ !!!

Efence supports C++ if your operators new and delete are
implemented in terms of malloc and free.

If they are not you can write your own overloads which are.

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

From: Tom Glass <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Re: Electric Fence for C++ ???
Date: Wed, 01 Mar 2000 11:22:03 -0800
Reply-To: [EMAIL PROTECTED]

Kaz Kylheku wrote:
> 
> On Wed, 01 Mar 2000 17:42:46 +0100, Anes Lihovac <[EMAIL PROTECTED]> wrote:
> >Hi !
> >
> >I am searching for a Library which like EFENCE
> >but for C++ !!!
> 
> Efence supports C++ if your operators new and delete are
> implemented in terms of malloc and free.
> 
This is the case with the g++ compiler, I use efence and it works well
for me.

> If they are not you can write your own overloads which are.

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

From: [EMAIL PROTECTED] (Chris)
Subject: Re: clone threads ...
Date: Wed, 01 Mar 2000 18:45:19 GMT

On 28 Feb 2000 01:05:20 GMT, "Vitaliy Rabotnik"
<[EMAIL PROTECTED]> wrote in comp.os.linux.development.apps:

>I need to implement the "dinning philosophers problem" using threads in
>Linux OS.

What is the "dining philosophers problem"?  (I love a challenge.)


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

From: [EMAIL PROTECTED] (Dixon Ly)
Crossposted-To: comp.os.linux.development
Subject: Re: pthreads - shared memory
Date: 1 Mar 00 08:32:19 GMT


I think I am running into the same problem.  I am quite new to
threads...so please correct me if I am wrong about this:

Each thread should share the same memory/stack as the main process.
So if I have some globals declared in main, then the thread should
be able to access it....

Example:

/*global */
char buffer[1024];

int main(void) {
        ...
        sprintf(buffer, "blah blah blah");

        ...
        ...
        ...code to pthread_create....
}

then
in the thread, I try to access buffer and get an invalid pointer.
Now, if I declare buffer as:
    char *buffer;  
   
 and in main:
    buffer = (char *)malloc(1024);

before doing the sprintf, then things work like a charm.
This would seem like a big problem, wouldn't it?

-d

P.S.  I am seeing this with both the RedHat 6.0 and 6.1 
kernels with pthread.


In article <[EMAIL PROTECTED]>, Florian Waas  <[EMAIL PROTECTED]> wrote:
>
>> I'm writing a C++ program where I use POSIX threads (pthread).  What
>> I can't seem to do, is to make the main thread and the
>> "children"-threads share the same memory. Is there a way to do that?
>> I need to set some global variables from both the main thread and
>> the other threads.
>
>what you're looking for is actually the standard behavior of pthreads.
>can you describe your problem a bit more specific? little code example?
>
>
>fl.
>



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

From: [EMAIL PROTECTED] (Chris)
Subject: Re: dbm / ndbm use
Date: Wed, 01 Mar 2000 19:02:26 GMT

On Wed, 1 Mar 2000 14:42:55 +0100, "Rafael García" <[EMAIL PROTECTED]>
wrote in comp.os.linux.development.apps:

>And at any moment (perhaps during new insertions) another proccess needs to
>read all keys between 200000
>and 300000. It seems I could use dbm/ndbm except I cannot get a set of
>records: I have to start reading at the first key.

SQL (Structured Query Language) allows you to select an entire group of
records as either a static set (copy) of the database or an dynamic set
(boundary records).  Most Linux distros include MySQL and PostgreSQL, both
of which are supported by libraries and interfaces for just about any
programming language you can imagine.


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

From: Aaron Bentley <[EMAIL PROTECTED]>
Subject: Date bugs in glibc?
Date: Wed, 01 Mar 2000 19:48:56 GMT

The program I'm working on uses the current date for several essential
and non-essential functions.
I'm using the POSIX time functions:
time()
tzset()
strftime()
I'm using RedHat 6.0, and glibc 2.1.1 sometimes thinks it's March 3.
Code:
---
curtimedate=time(NULL);
 tzset();
 tmcurtimedate=localtime(&curtimedate);
 strftime(scurtimedate, 29, "%I:%M %p %m %b, %Y", tmcurtimedate);
 printf("Seconds since 1970 %li\n Time according to thingy: %s\n",
(long) curtimedate, scurtimedate);
---

Output:
---
Seconds since 1970 951938078
Time according to thingy: 02:14 PM 03 Mar, 2000
---
Ideas?

Aaron
--
Aaron Bentley
Manager of Information Technology
Panoramic Feedback
www.panoramicfeedback.com



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

From: [EMAIL PROTECTED] (Kevin Smith)
Crossposted-To: 
alt.os.linux,comp.os.linux.development.system,comp.unix.sco.misc,comp.unix.sco.programmer,comp.unix.unixware.misc,tw.bbs.comp.linux
Subject: Re: Struct size and allocate problem! need help.
Date: 1 Mar 2000 15:39:33 -0500

In article <[EMAIL PROTECTED]> "Jaron" <[EMAIL PROTECTED]> writes:
>Hi,
>    I encounter a compiling program as below:
>
>    struct    a {
>        unsigned char    a1;
>        unsigned char    a2;
>        unsigned short    a3
>        unsigned short    a4
>        unsigned long    a5;
>    };
>
>the structure size must be 10 but use sizeof print out is 12...
>...snip...

You don't say why it has to be 10.  Usually this means you are overlaying
the structure on some external data (i.e. a file) and this is how you
bring the data into the program (or back out).

I gave up trying to do that years ago due to constant packing and byte
order problems.  Now-a-days I use an unsigned char array for the external
representation and map the data in and out of my internal structures
with appropriate functions (or macros).

-- 
Do two rights make | Kevin Smith, ShadeTree Software, Philadelphia, PA, USA
a libertarian      | 001-215-487-3811  shady.com,kevin   bbs.cpcn.com,sysop
                   | dvtug.org,kevins--Deleware Valley Transit Users Group

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

From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Re: Semaphore quustion ... part 2!! Bug ?
Date: Wed, 01 Mar 2000 14:51:43 -0500

Each process pretty much locks the semaphore again right after it
unlocks....which effectively prevents any body else from getting a chance to
lock the semaphore.  Either do some more work between unlock->lock
periods...or do something that at least causes a context switch so at least
another process gets a crack at trying to do something.

Either that....or use a two stage semaphore.

something like:

lock semaphore 1
lock semaphore 2
free semaphore 1
        do operation
free semaphore 2

mark wrote:
> 
> Hi all,
>     I know I recently posted a question one semaphores (Thanks for the
> replies) but I'm still having problems with them ... not convinced
> they're working properly!
> 
> This is an interleaving of what I can see happening (Where the Writer
> process starts a little before the Reader - not that this should cause a
> problem).
> 
> Writer Gets Semaphore
> Writer Returns Semaphore
> Writer Gets Semaphore
> Reader Tries Semaphore - Blocked
> Writer Returns Semaphore
> Writer Gets Semaphore
> Writer Returns Semaphore
> etc...
> Reader might get to play if its lucky
> 
> Its not helped by the fact its not always the same process that does
> this (The Reader can end up with the semaphore for ages as well.)
> 
> The problem is one process is effectively able to jump the queue
> (Somehow!!) and keep the semaphore for itself - even when the other
> process was blocked  that semaphore. The programs are so simple its
> either some really stupid I'm doing (Quite possible!) or the semaphore
> semop() function has a bug.
> 
> I dumped the code for the Reader and Writer processes below. If anyone
> is able to try it out I'd really appreciate it. This is pretty annoying
> ! :) Another odd fact is you'll notice there are two lines in each bit
> commented out (All they do is print out the Semaphore at that time). The
> problem doesn't seem so bad when there compiled in!!???
> 
> I've also tried using shed_yeild() when the processes gives up the
> semaphore, however I don't believe it will make any difference as the
> process should block anyway.
> 
> These are System V semaphores, are there any known problems with them?
> POSIX any better? If so where can I get info on how to use them (I
> assume there more up to date).
> 
> Just for the record I'm running Linux 2.2.14
> 
> Thanks in advance
> 
> Mark
> 

-- 
    Who: Lawrence Chen, P.Eng.          Email: [EMAIL PROTECTED]
   What: Software Developer               URL: http://www.opentext.com/basis
  Where: Open Text, BASIS Division      Phone: 614-761-7449
         5080 Tuttle Crossing Blvd.       Fax: 614-761-7269
         Dublin, OH  43016                ICQ: 12129673
  DISCLAIMER: All opinions expressed are mine and *NOT* my employers

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


** 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.apps) 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-Apps Digest
******************************

Reply via email to