Linux-Development-Sys Digest #640, Volume #7      Wed, 1 Mar 00 03:13:18 EST

Contents:
  Re: Linux ODBC (Christopher Browne)
  Re: Problem with SIGALRM and rad() from a pipe (Oliver Bandel)
  glibc building problem (Krik Lee)
  Re: System hanging with SMP-Kernel 2.2.13 (SuSE6.3)? (Robert Redelmeier)
  Re: complex math in a device driver (Charles Bryant)
  Re: GCC and EGCS, SuSE say they can co-exist, I don't see how (Markus Kossmann)
  kernel thread and inter lock ("Sake")
  Re: Compiling the kernel ("Sake")
  Re: clone threads... ("Sake")
  Re: an alternate default for LILO ("Sake")
  Re: clone threads... (Kaz Kylheku)
  Re: kernel thread and inter lock (Kaz Kylheku)
  Struct size and allocate problem! need help. ("Jaron")
  Re: an alternate default for LILO ([EMAIL PROTECTED])
  Re: Why a file system ? ([EMAIL PROTECTED])
  Re: Struct size and allocate problem! need help. (Chris Zagar)

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

From: [EMAIL PROTECTED] (Christopher Browne)
Subject: Re: Linux ODBC
Reply-To: [EMAIL PROTECTED]
Date: Wed, 01 Mar 2000 01:24:54 GMT

Centuries ago, Nostradamus foresaw a time when John Smith would say:
>are there any odbc c/c++ libraries available?

Yes.

[See URL below.]
-- 
"It is easier  to optimize correct code, than  correct optimized code"
-- Yves Deville
[EMAIL PROTECTED] <http://www.ntlug.org/~cbbrowne/middleware.html>

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

From: Oliver Bandel <[EMAIL PROTECTED]>
Subject: Re: Problem with SIGALRM and rad() from a pipe
Date: 1 Mar 2000 02:30:19 +0100

Hi!

John Agnew <[EMAIL PROTECTED]> wrote:
> Hi All,

> I've an interesting problem with the following piece of code under Linux.
> What I expect when the alarm expires is that the read from the pipe "pipe1"
> terminates - this is what
> happens under other version of Unix - but under Linux the read continues.
> The effect is that
> the program appears to have hung.

> Any ideas on this ?

Any? Many! 

Why don't you use  sigalarm()  instead of signal?
If you use open(2) instead of fopen(3) and use
Pipes, you are no more in the ANSI-zone. 

So use sigalarm()/sigaction()....

Think about SA_RESTART.



[...]
>         fprintf(stderr, "alarm came\n");
> }

BTW: (f)printf-statements should be avoided in signal-handlers...


> main()
> {
> int     Salarm_signal = 0;
> int     fp;

> signal (SIGALRM, Salarm);
> alarm ((unsigned)5);
         ^^^^^^^^^^^\
                    5 is unsigned. isn't it?

> fprintf(stderr, "before open\n");
> fp = open("pipe1", O_RDONLY);

You can use option O_NONBLOCK in open()-call for nonblocking operation.
Or you can use fcntl() and change the options later.

If nonblocking read() is used, you don't need the alarm.

Maybe you are interested in the functions  select(2) and poll(2)
for multiplexing between fd's.
Then you can set a timeout value and don't need the signal handler
for this purpose.


> fprintf(stderr, "after open\n");
> fflush(stderr);

stderr is flusht automatically.


Ciao,
   Oliver
-- 
Question: Are there equal files in this directory tree?
Hint: New version of multiple is available now. It will answer you.
ftp://www.belug.org/pub/user/ob/Programs/Tools/multiple-0.2.tgz

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

From: Krik Lee <[EMAIL PROTECTED]>
Subject: glibc building problem
Date: Wed, 01 Mar 2000 10:23:28 +0800

Dear All:

  I want to build a glibc for arm processor.
  So, I got glibc2.1.2, gcc-2.95.2, binutils-2.9.5.0.27 and linux kernel
2.2.14
  to build a cross-platform version of them.

 After I successfully built binutils, gcc, and linux kernel, however, I
encountered
 " ../elf/ld-linux.so.2: undefined reference to `__libc_global_ctors' "
 error messgae when I am building glibc!!

 Could anyone tell me how to solve this problem??

 Thanks !!

 kirk


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

From: Robert Redelmeier <[EMAIL PROTECTED]>
Subject: Re: System hanging with SMP-Kernel 2.2.13 (SuSE6.3)?
Date: Tue, 29 Feb 2000 20:17:14 -0800

bill davidsen wrote:
> In article <890g54$r75$[EMAIL PROTECTED]>,
> Yuan <[EMAIL PROTECTED]> wrote:
> | Is there anybody who knows whether there is any problem with the SMP-kernel
> | 2.2.13 [SuSE 6.3]?
> | We've got a problem with this kernel on a Dell's PowerEdge 6350
> | system [4 x PIII Xeon 550MHz, 2GB EDO DIMM RAM, Intel's Ether DualPort Pro100+]:
> | it hangs sometimes.
> | The /var/log/messages file didn't show any hints about what caused the hanging.
> | Usually the system could only be reusable after rebooting (press reset-button)
> | again (it didn't respond to pings during the hanging or anything else,
> | i.e.: no telnet, no ftp-> a total k.o. :-<].
>   I've seen this on a distressing number of Linux SMP systems, and Alan
> Cox seems to say that he agrees. On the other hand I have two systems on
> 2.2.6 and one on 2.2.10 which have been up for 44/88/69 days under heavy
> network load. 2.2.14 seems better than 2.2.13, and you might try Alan's
> latest pre-release patch if you are brave.
> 
> | Hope I can get a bit more hints from this gurus group, ;-).
> Wrong group, lots of helpful folks here, but the gurus are pretty quiet.

It could also be hardware.  I developed `burnP6` and `burnBX` to test 
out the CPU[s] and Northbridge/SDRAM systems (respectively).  CPUs can
certainly lockup if inadequately cooled.  Northbridge (BX, GX, etc) and
SDRAM will usually give errors first, but also can lock hard.  These 
userland programs should certainly run indefinitely (at least multiple 
hours) error-free on stable hardware.

-- Robert  author `cpuburn` at:  http://users.ev1.net/~redelm

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

From: Charles Bryant <[EMAIL PROTECTED]>
Subject: Re: complex math in a device driver
Date: 1 Mar 2000 03:18:47 -0000

In article <89gv8n$dvh$[EMAIL PROTECTED]>,
Dan Miller <[EMAIL PROTECTED]> wrote:
... operations in a driver ...
>This is all well and good, but my computational requirements are *much* more
>complex than A/D conversion.  A typical computation in my set is:
>
>     temp2usl = 0x0000000f & (unsigned long) floor( 0.5 + 16.0*(( m1a *
>                  pow(2.0,-1.0*(double)( floor(log10( m1a )/log10of2) )) ) -
>1.0) );

That seems to be a very expensive way of portably doing:
        0xf & (v >> 23)
where 'v' is 'm1a' as an int. In other words, it's extracting the
four most significant bits of the mantissa. Maybe if you could give
more information about what you're trying to do the requirement to do
it using floating point could be eliminated.

-- 
Eppur si muove


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

From: Markus Kossmann <[EMAIL PROTECTED]>
Subject: Re: GCC and EGCS, SuSE say they can co-exist, I don't see how
Date: Wed, 01 Mar 2000 04:24:14 +0100

Robin Collins wrote:
> 
> According to the SuSE installer one can install EGCS and GCC together,
> you either install GCCFRONT or EGCS but not both, looking at the files
> they install I can see why.
> 
> My problem is I don't see how to make them live together!  If I
> install EGCS then GCC runs EGCS, if I install GCCFRONT GCC runs GCC
> 2.7.2.3.
> 

If you use the switch -V2.7.2.3 the egcs gcc frontend will run the
gcc-2.7.2.3 backend.

To compile the kernel, edit the toplevel kernel Makefile and add that
switch to the line 
CC      =$(CROSS_COMPILE)gcc -D__KERNEL__ -I$(HPATH)


--
Markus Kossmann                                    
[EMAIL PROTECTED]

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

From: "Sake" <[EMAIL PROTECTED]>
Subject: kernel thread and inter lock
Date: Tue, 29 Feb 2000 23:10:39 -0500

Hi,

I'm new to Linux kernel. Trying to port certain driver code from other
OS to Linux and here are my questions:

1) is there a way to spawn off a kernel thread/process something like
'newproc(..)' or the like ?

2) if the answer to1) is yes, then what is the inter lock machanism for
concurrency
control betweem kernel threads. I know you can use interrupt, but is there
other way
of doing lock/unlock. Or is there a 'tas' (test-and-set) routing can be used
?

Any info is appreciated.
Thanks

[EMAIL PROTECTED]




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

From: "Sake" <[EMAIL PROTECTED]>
Subject: Re: Compiling the kernel
Date: Tue, 29 Feb 2000 23:19:30 -0500


James <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I need to re-complie my kernel but the make command isn't recognised by
> bash, how do i change this?
>
Without more info, I would guess:
1) you haven't installed GNU tools
2) you installed GNU tools in a unusual place which is not in your PATH
3) your PATH is screwed up
> --
> Posted via CNET Help.com
> http://www.help.com/



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

From: "Sake" <[EMAIL PROTECTED]>
Subject: Re: clone threads...
Date: Tue, 29 Feb 2000 23:25:49 -0500


Derek Callaway <[EMAIL PROTECTED]> wrote in message
news:89co2o$[EMAIL PROTECTED]...
> Vitaliy Rabotnik <[EMAIL PROTECTED]> wrote:
>
> > Could anyone show an example of use of the clone system call?
>
> > I need to implement the "dinning philosophers problem" using threads in
> > Linux OS.
> > I was told to use clone method to create threads, but I need to see  an
>
> I suggest using a library that does the clone() calls for you like
> libpthread (POSIX threads).
>
> > example how it is done...
> > Thank you.
>
> The source of linuxthreads (available with glibc) has quite a few
> examples, although they may be a bit obscure.
>

WHERE ARE THEY ? THANKS
> --
> /* Derek Callaway <[EMAIL PROTECTED]> char
*sites[]={"http://www.geekwise.com",
>    Programmer; CE Net, Inc.
"http://www.freezersearch.com/index.cfm?aff=dhc",
>    (302) 837-8769           "http://www.homeworkhelp.org",0};  S@IRC  */



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

From: "Sake" <[EMAIL PROTECTED]>
Subject: Re: an alternate default for LILO
Date: Tue, 29 Feb 2000 23:46:44 -0500

Can you put something in the lilo.conf file that can be recognized by your
modified Lilo.
Basically, your modified Lilo will use this flag in lilo.conf to edit
lilo.conf for next boot.
This may solve part of your problem

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Having gotten no help after explaining what I wanted to do, I proceeded to
> try to come up with an idea to accomplish it.  I don't have enough
background
> to do all of this, so I'll be looking for some kind of help from someone
who
> does.
>
> What I want to do is modify LILO so that it knows of not one default
system
> to boot, but two.  There will be an alternate default system.  Perhaps it
> can be the 2nd system in the lilo.conf file.  When LILO runs to boot up a
> system, it will look for this special flag in RAM or maybe in some other
> hardware.  Exactly where this flag will be and how to detect it is the big
> crucial part of this.  The flag MUST be something that will be cleared out
> if there is a hard reset (pressing the reset button) and obviously if the
> power is cycled off and on.  The flag MUST NOT be cleared when Linux does
> a software reboot (e.g. shutdown -r now).  The modified LILO must be able
> to clear the flag itself, and will do so when it detects it.
>
> When LILO detects this flag, and no other system is typed in, it will boot
> the alternate system, but before doing so, it will clear the flag.
>
> When LILO does not detect this flag, it will boot the primary default
system.
>
> Then I will modify the Linux kernel so that it will, when a specific case
> exists, leave the flag for LILO when it does a soft reboot.  The purpose
is
> so that I can have Linux reboot to a different OS when I want it to.  But
> that other OS will not be rebooted a 2nd time without first running the
> primary Linux system.  The purpose for me is so that Linux can actually
> build the system it is about to start up.  It will load the raw drive or
> partition image of that system from a networked file server, or a CDROM,
> and then set the flag and reboot, thus starting up the other system it
just
> built.
>
> I do not know enough about the real mode state of a PC or Intel machine to
> know just what my options might be for leaving this flag.  I suspect it
will
> not be so simple as a 1-bit somewhere.  More likely, it could be a long
> string of specially coded characters that are very unlikely to happen by
> chance.  It could be "LILO: please load the alternate system this time put
> in some obscure memory location, such as in the last block of the old VGA
> video buffer space (but if a soft reboot or the BIOS wipes this out, then
> something else will be needed).
>
> Another alternative is if the Linux kernel itself could load the other
> system directly and invoke it.  Given that the jump to it would be in
> protected mode, that could be a problem (systems tend to expect to start
> in real mode, right?).  OTOH, if some protected mode code can switch back
> to real mode before the jump, that just might do it.
>
> The goal is to use Linux to build another system on the fly and boot it
up,
> and repeat the process (run Linux to build another system and boot it)
each
> time there is a reboot cycle.
>
> --
> | Phil Howard - KA9WGN | for headlines that | Just say no to absurd
patents |
> | [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)
|
> | Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead
|



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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: clone threads...
Reply-To: [EMAIL PROTECTED]
Date: Wed, 01 Mar 2000 04:54:33 GMT

On Tue, 29 Feb 2000 23:25:49 -0500, Sake <[EMAIL PROTECTED]> wrote:
>
>Derek Callaway <[EMAIL PROTECTED]> wrote in message
>news:89co2o$[EMAIL PROTECTED]...
>> The source of linuxthreads (available with glibc) has quite a few
>> examples, although they may be a bit obscure.
>>
>
>WHERE ARE THEY ? THANKS

In the glibc-linuxthreads-2.1.3.tar.gz tarball.

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: kernel thread and inter lock
Reply-To: [EMAIL PROTECTED]
Date: Wed, 01 Mar 2000 04:58:57 GMT

On Tue, 29 Feb 2000 23:10:39 -0500, Sake <[EMAIL PROTECTED]> wrote:
>Hi,
>
>I'm new to Linux kernel. Trying to port certain driver code from other
>OS to Linux and here are my questions:
>
>1) is there a way to spawn off a kernel thread/process something like
>'newproc(..)' or the like ?

It's done using the kernel_thread() function.

>2) if the answer to1) is yes, then what is the inter lock machanism for
>concurrency
>control betweem kernel threads. I know you can use interrupt, but is there
>other way
>of doing lock/unlock. Or is there a 'tas' (test-and-set) routing can be used
>?

For fast critical sections that need not involve the scheduler, you can use
spin_lock_irqsave() and spin_unlock_irqrestore() for fast critical regions.
(These reduce to interrupt disabling on single-processor kernels).  You can
also use semaphores for longer waits that require rescheduling. I have created
a simple mutex and condition variable module.
http://users.footprints.net/~kaz/lmc.html

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

From: "Jaron" <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux,comp.os.linux.development.apps,comp.unix.sco.misc,comp.unix.sco.programmer,comp.unix.unixware.misc,tw.bbs.comp.linux
Subject: Struct size and allocate problem! need help.
Date: 1 Mar 2000 06:22:01 GMT

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 ?



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

From: [EMAIL PROTECTED]
Subject: Re: an alternate default for LILO
Date: Wed, 01 Mar 2000 07:26:59 GMT

On Tue, 29 Feb 2000 23:46:44 -0500 Sake <[EMAIL PROTECTED]> wrote:
| Can you put something in the lilo.conf file that can be recognized by your
| modified Lilo.
| Basically, your modified Lilo will use this flag in lilo.conf to edit
| lilo.conf for next boot.
| This may solve part of your problem

The flag cannot be put in lilo.conf for the following reason.  The flag
is an indication that must be reset when the power cycles.  If the power
cycles, then I want LILO to boot the primary default instead of the
alternate default.  If it were as simple as putting a flag in lilo.conf
then I could just as easily just change lilo.conf so that the alternate
system is first, run "lilo", and reboot.  However, the alternate system
probably has no knowledge of how to rewrite lilo back to the primary.

If someone walks up to the machine while it is running the alternate OS
and presses the RESET button, I want the PRIMARY system to come up.  The
primary system will then set up and run the alternate system.  Same for
a power failure followed be a resumption of power.

One of the scenarios I want to use this for is the primary system will
get a raw disk partition image via the network and write it to a partition
designated for the alternate system.  That done, the alternate system has
a fresh pristine system image to run from.  Now the primary will indicate
to my kernel code that the flag is to be set (it may get set right then or
it may get set at the last instant in the final kernel shutdown, depending
on the nature of what this flag is).

The alternate system might be any alternate OS.  It could be FreeBSD, Linux,
Solaris, or even Windows NT or 2000 Server.  In the latter cases, it could
very well add to the stability (with some administrative complications).

Another scenario is that the primary system will boot from CD, uncompress
a large file from that CD to fill in the alternate system partition, and
proceed as above to run the alternate system.

One purpose for this is security.  If someone takes over the machine, it's
just a matter of forcing a hard reboot to get them out.  If they have not
compromised the primary system (which runs only briefly), which they cannot
do if it's a CDROM, or the file server where the system images are stored,
then the reboot will remove any infiltration, subject to making sure the
alternate system does not execute anything in other partitions (such as
web space) which may still be infiltrated.  There are a lot of other things
to work up on this, but it can become possible to do if the two-step boot
process can be accomplished.

Note.  In the case of the alternate OS being Linux, there is the possibility
of using the INITRD feature to accomplish this.  I've already experimented
with it, and it looks feasible.  However, I particularly want to be able to
"manage" NT like this.  One option for NT is VMWARE.  That's being considered.



| <[EMAIL PROTECTED]> wrote in message
| news:[EMAIL PROTECTED]...
|> Having gotten no help after explaining what I wanted to do, I proceeded to
|> try to come up with an idea to accomplish it.  I don't have enough
| background
|> to do all of this, so I'll be looking for some kind of help from someone
| who
|> does.
|>
|> What I want to do is modify LILO so that it knows of not one default
| system
|> to boot, but two.  There will be an alternate default system.  Perhaps it
|> can be the 2nd system in the lilo.conf file.  When LILO runs to boot up a
|> system, it will look for this special flag in RAM or maybe in some other
|> hardware.  Exactly where this flag will be and how to detect it is the big
|> crucial part of this.  The flag MUST be something that will be cleared out
|> if there is a hard reset (pressing the reset button) and obviously if the
|> power is cycled off and on.  The flag MUST NOT be cleared when Linux does
|> a software reboot (e.g. shutdown -r now).  The modified LILO must be able
|> to clear the flag itself, and will do so when it detects it.
|>
|> When LILO detects this flag, and no other system is typed in, it will boot
|> the alternate system, but before doing so, it will clear the flag.
|>
|> When LILO does not detect this flag, it will boot the primary default
| system.
|>
|> Then I will modify the Linux kernel so that it will, when a specific case
|> exists, leave the flag for LILO when it does a soft reboot.  The purpose
| is
|> so that I can have Linux reboot to a different OS when I want it to.  But
|> that other OS will not be rebooted a 2nd time without first running the
|> primary Linux system.  The purpose for me is so that Linux can actually
|> build the system it is about to start up.  It will load the raw drive or
|> partition image of that system from a networked file server, or a CDROM,
|> and then set the flag and reboot, thus starting up the other system it
| just
|> built.
|>
|> I do not know enough about the real mode state of a PC or Intel machine to
|> know just what my options might be for leaving this flag.  I suspect it
| will
|> not be so simple as a 1-bit somewhere.  More likely, it could be a long
|> string of specially coded characters that are very unlikely to happen by
|> chance.  It could be "LILO: please load the alternate system this time put
|> in some obscure memory location, such as in the last block of the old VGA
|> video buffer space (but if a soft reboot or the BIOS wipes this out, then
|> something else will be needed).
|>
|> Another alternative is if the Linux kernel itself could load the other
|> system directly and invoke it.  Given that the jump to it would be in
|> protected mode, that could be a problem (systems tend to expect to start
|> in real mode, right?).  OTOH, if some protected mode code can switch back
|> to real mode before the jump, that just might do it.
|>
|> The goal is to use Linux to build another system on the fly and boot it
| up,
|> and repeat the process (run Linux to build another system and boot it)
| each
|> time there is a reboot cycle.
|>
|> --
|> | Phil Howard - KA9WGN | for headlines that | Just say no to absurd
| patents |
|> | [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)
| |
|> | Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead
| |



-- 
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |
| [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)     |
| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

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

From: [EMAIL PROTECTED]
Subject: Re: Why a file system ?
Date: Wed, 01 Mar 2000 07:58:25 GMT

On Tue, 29 Feb 2000 02:08:35 GMT Christopher Browne <[EMAIL PROTECTED]> wrote:

| There is certainly room to use the (from-database management) notion
| of having multiple "views" on data.  In SQL, you can create something
| called a "view," which is a sort of "virtual table" that is a closure
| that may join together tables and some implicit selection criteria.
|
| It is certainly a reasonable idea to do the same sort of thing with a
| filesystem, having some alternative views on data.
|
| But the notion of pushing everything into databases is not
| realistically useful.
|
| In particular, I would contend that it does not do anything to keep
| the system "clean."  

If you have everything on a database, then what is the definition of
the layer the database is on?  The current notion in UNIX is that a
database engine sees the same process API layer than any other program
does, save for the extended permissions and access it is granted.

But in a system where everything is in the database, then would that
database still be in a process as it is now?  Or would it be inside
the kernel?

In order to give all processes that need the data an abstraction to
access the data, and to give the database engine itself an abstraction
to access the hardware, you'd have to add another layer between the
kernel and user space processes, and it would be more than just the
pseudo-layer of processes with root permissions.

It could be a particularly obese kernel.  It would most definitely
be "unclean".


| In the same manner that you can see a file system get "crufty" when
| people strew trash everywhere, a database system can suffer from
| *exactly the same problem.*

Absolutely.  Now what tools have we handy to clean this up?  What?
we need a whole NEW set of tools?


| I work with a system called R/3, where programs are not stored in
| files, but rather in one Rather Big SQL table.  This does *not* lead
| to things being particularly more manageable; you wind up with there
| being HUGE quantities of "junk" in that one table, and the lack of
| the hierarchy you'd find in a filesystem creates some problems that
| you didn't have with a filesystem.

I have already thought about the idea that databases need to have some
more hierarchy to them.  This shows the disadvantage of lacking it.


| Of course, all of this has been ignoring the fact that the fact that
| in UNIX, everything is a hierarchy of files is generally considered a
| FEATURE rather than a bug.  

Exactly.


| The likely direction is *not* to move towards "everything becomes a
| database;" it is more likely that people may create front ends that
| allow databases to be treated as if they were hierarchical
| filesystems.  

That could be useful.


| It would, for instance, be a slick idea if I could do:
| % mkdir ~/Databases/mydb
| % usermount -t gdbm ~/DBs/something.dbm ~/Databases/mydb
| % cd ~/Databases/mydb
| % ls
| key1
| key2
| key3
| key4
| key5
|
| where the mapping would be that each file in the directory is named
| after the key in the GDBM DB, and the contents of the file are the
| values associated with the keys...

Interesting idea.  Of course there are complications such as more
than one key.  But then, in a hierarchy, you can have as many branches
as you want.  You can make the table be one level and each key the
next.


| Something similar could be done for an SQL DBMS:
|
| % usermount -t postgresql "localhost:3144 somedb userid password" \
|   ~/Databases/thebigdb
|
| and you'd be able to see a directory of tables and such...

Or each of the different views.  Or make new views.

-- 
| Phil Howard - KA9WGN | for headlines that | Just say no to absurd patents |
| [EMAIL PROTECTED] | really matter:     | Boycott Amazon.Com (AMZN)     |
| Dallas - Texas - USA | linuxhomepage.com  | Shop http://bn.com/ instead   |

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

From: Chris Zagar <[EMAIL PROTECTED]>
Crossposted-To: 
alt.os.linux,comp.os.linux.development.apps,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 01:00:08 -0700

When possible, my first recommendation is to reform your struct with
variables from largest size to smallest, such as:

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

as some architectures become really annoyed when you access a variable
that isn't aligned on its natural boundary.  However, assuming that
isn't an option, try:

#pragma pack(1)
    struct    a {
        unsigned char    a1;
        unsigned char    a2;
        unsigned short   a3;
        unsigned short   a4;
        unsigned long    a5;
    };
#pragma pack()

This #pragma will force alignment to the byte level (size 1), and make
your structure 10 bytes in size.

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 ?

Chris Zagar <[EMAIL PROTECTED]>


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


** 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