Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C Shared memory and Forks

Name: a 2014-02-27 20:13

I am stuck on my assignment if anyone could help me that would be great.

assignment:
Each program creates two children processes: The first is “Alice” and the 2nd is “Bob”
Alice and Bob communicate using the following IPC methods:
 
          shared memory

Alice and Bob uses Diffie-Hellman to establish a shared secret to be  used  for encrypting their communication.

For the purpose of this assignment, assume:

p = 103
g = 101
SA   and  SB   are random numbers between 1 and 100.

My Code: http://pastebin.com/mdxzxc4x

Name: Anonymous 2014-02-27 20:15

install BSD/TempleOS

Name: a 2014-02-27 20:35

I am already running it on linux now and I fixed most errors
my vim editor gives error messages which were messed up so I had to use putty
This is the improved code
http://pastebin.com/9JSyW043
Do I need to use an array of int? or can i pass int to shared memory?

Name: Anonymous 2014-02-27 20:45

Sounds like a linker problem to me. Did you make sure to edit your makefile to link everything in?

Name: Anonymous 2014-02-27 20:48

>>4
The linker is a stinker.
-Wl,-lulz

Name: a 2014-02-27 21:06

http://pastebin.com/YZUwF4xa

Yes I checked linker but still same error but I added in the parent code.

Name: Anonymous 2014-02-27 21:19

Try using a different linker. Clang's linker is much better than GCC's, and the error messages are much less obtuse.

Name: vomit makes me cum 2014-02-27 21:39

vomit makes me cum

Name: a 2014-02-27 21:41

vomitimage.jpeg

Name: Anonymous 2014-02-28 2:55

Shared memory
Shalom!

fork
Shalom!

usleep
Shalom!

(char *)
Shalom!

random
Shalom!

sprintf(shared_memory, T_a);
what the fuck are you doing nigga? T_a is a int, you may want to use sprintf(shared_memory, "%d", &T_a);

printf("\nAlice's random secret = %d", S_b);
no! this is bob's ``random'' ``secret'', same goes for T_b. I have no idea what you are trying to do

Name: AHMED 2014-02-28 8:16

­

Name: Anonymous 2014-02-28 10:53

>>11
>le pedophile AHMED

Name: Anonymous 2014-02-28 23:50

#include <cutlery.h>

Name: Anonymous 2014-03-01 2:10

Just use shared transactional memory, faggot.

Name: Anonymous 2014-03-01 4:38

Y'ALL IS A BUNCH OF DIRTY NIGGERS

Don't change these.
Name: Email:
Entire Thread Thread List