Sponsored Content
Full Discussion: C++ to C
Top Forums Programming C++ to C Post 302397367 by Corona688 on Monday 22nd of February 2010 01:46:27 AM
Old 02-22-2010
As usual, I can't see your code from here so can't tell why it's segmentation faulting. if I had to guess, I'd guess you were feeding integers into crc_add instead of pointers to integers.

Code:
// For integers, objects, etc 
crc_add(&crc, &object, sizeof(object));
// for arrays
crc_add(&crc, array, sizeof(array));
// for a pointer
crc_add(&crc, pointer, sizeof(*pointer));
// for a string
crc_add(&crc, string, strlen(string));

This is all from basic understanding of pointers in the C language.
 
TR(4)							   BSD Kernel Interfaces Manual 						     TR(4)

NAME
tr -- TROPIC based shared memory Token-Ring cards device driver SYNOPSIS
tr0 at isa? port 0xa20 iomem 0xd800 irq ? tr* at isa? port ? irq ? tr* at isapnp? tr* at mca? slot ? tr* at pcmcia? function ? DESCRIPTION
The tr device driver supports TROPIC I based shared-memory Token-Ring cards. HARDWARE
Supported cards include the following IBM and 3Com models: IBM Token-Ring Network PC Adapter IBM Token-Ring Network PC Adapter II IBM Token-Ring Network Adapter/A IBM Token-Ring Network 16/4 Adapter IBM Token-Ring Network 16/4 Adapter/A IBM Token-Ring 16/4 Credit Card Adapter IBM Token Ring Auto 16/4 Credit Card Adapter IBM Turbo 16/4 Token Ring PC Card IBM 16/4 ISA Adapter IBM Auto 16/4 Token-Ring ISA Adapter IBM Token Ring 16/4 Credit Card Adapter IBM Token Ring Auto 16/4 Credit Card Adapter IBM Turbo 16/4 Token Ring PC Card 3Com 3C619 TokenLink 3Com 3C319 TokenLink Velocity 3Com 3C389 TokenLink Velocity PC Card SOURCE ROUTING
Setting IFF_LINK0 enables Token-Ring source routing. Setting IFF_LINK1 uses all-routes broadcasts otherwise single-route broadcasts are used. NOTES
The MCA attachment has been only tested on IBM Token Ring 16/4 Adapter/A so far. It doesn't support ifmedia(4) yet, too. SEE ALSO
ifmedia(4), intro(4), isa(4), isapnp(4), mca(4), pcmcia(4), ifconfig(8) HISTORY
The tr driver appeared in NetBSD 1.4. BUGS
The PCMCIA attachment does not work with the cbb(4) CardBus driver. BSD
April 14, 1999 BSD
All times are GMT -4. The time now is 05:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy