[sclug] C programming question and date on Linux

pieter claassen pieter at openauth.co.uk
Sat Oct 25 09:05:36 UTC 2003


Hello All,

Here are two simple questions.
1. Why does C on linux have such cool undocumented data types such as
u_int16_y and where are they documented? My Kernighan and Ritchie says
nothing about them. How do I know when I write a program which ones I am
supposed to use? Also, if I look through the /net/ethernet.h I get the
following declaration

struct ether_header
{
  u_int8_t  ether_dhost[ETH_ALEN];      /* destination eth addr */
  u_int8_t  ether_shost[ETH_ALEN];      /* source ether addr    */
  u_int16_t ether_type;                 /* packet type ID field */
} __attribute__ ((__packed__));

What is the __attribute__((__packed__)); about and where can I get more
info on that? How do I find out where ETH_ALEN comes from?

2. My PC clock is always way out and it seems to stay out. Firstly, how
do I set daylight savings in the command line and is there a simpler way
to set the date than with date -s foo? Is there is way to stop this
problem (there must be time servers online with appropriate clients that
does this magic securely)?

Thanks,
Pieter
-- 
-----------------------------
Pieter Claassen
pieter at openauth.co.uk
http://www.openauth.co.uk

OpenAuth
Tel: 01344 390530
DDI: 01344 390630/390631
Fax number: 01344 390700
Mobile:  0776 665 6924

Highview House
Charles Square
Bracknell
Berkshire
RG12 1DF

TERMS AND CONDITIONS
(i)The information contained in this email and attachments is only
intended for the addressed recipient(s) and may not be distributed or
viewed by any other party without the explicit consent of the sender. If
you have received this message by accident, please contact Pieter
Claassen (pieter at openauth.co.uk) and destroy any electronic or physical
copies of the information contained in it, immediately.
(ii)This email is not certified to be virus free and OpenAuth accepts no
liability for losses arising from you receiving this email.
(iii)Any digital signatures (if present) used to authenticate this
email, only serves to allow you to verify the originating email address
of the sender and should not be relied upon to prove identity or base
financial transactions on, unless the Certificate Practice Statement
that the signature references, explicitly states differently.
(iv)This email may be subjected to further terms and conditions as
published on the company website at http://www.openauth.co.uk. If you
need to rely on the information contained in this email in any way, then
you should read those terms and conditions to understand how much you
can trust the information in this email.
(v)OpenAuth retains the copyright on any relevant material that is
included in this email.




More information about the Sclug mailing list