Thread: To C programmers in Unix

  1. #1
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225

    Post To C programmers in Unix

    Guys and gals,

    I'm currently venturing into sockets programming and subsequently, I ran into two functions which I'm not quite familiar. They are the bcopy() and bzero() functions.

    You see... I'm an MS-Windows (and MS-DOS) user (I like it very much) and programmer (now don't strangle me hehehe... ). Anyway, those functions are obviously present in Unix and used in its sockets programming.

    I already have an idea of what they do:

    bzero() can set the address structure of something with zeros.

    bcopy() can be used to copy the IP address of the data structure of the host into the data variable associated with struct sockaddr_in.

    But knowing these just aren't enough for me. If anyone here knows more about the essentials of their function prototypes and some details of how these functions work, you can fill me in on it .

    Your knowledge will certainly help me in creating a my own similar bcopy() and bzero() for my program (if I can't find something similar in Windows).
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

  2. #2
    Registered User alex's Avatar
    Join Date
    Sep 2001
    Posts
    132
    Just convert them to the almost equivalent ISO 9899 functions:

    bzero(a, b) -> (void)memset(a, 0, b)
    bcopy(a, b, c) -> (void)memcpy(b, a, c)

    alex

  3. #3
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225

    Lightbulb

    Hmmm...

    My goodness I never thought of that.

    Thanx Alex!
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

  4. #4

  5. #5
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225
    Nice link Nick
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to program in unix
    By Cpro in forum Linux Programming
    Replies: 21
    Last Post: 02-12-2008, 10:54 AM
  2. Setting up a Unix box
    By @nthony in forum Tech Board
    Replies: 6
    Last Post: 07-22-2007, 10:22 PM
  3. UNIX (Linux, BSD, etc) Programming :: UNIX
    By kuphryn in forum Linux Programming
    Replies: 6
    Last Post: 04-01-2004, 08:44 PM
  4. Programming Puns
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 44
    Last Post: 03-23-2002, 04:38 PM
  5. About Unix Programming - Making a career desision
    By null in forum C Programming
    Replies: 0
    Last Post: 10-14-2001, 07:37 AM