Nils
the new thread never reaches my code
Nils
it crashes on first instruction
Vlad
no
It literally says that you call NULL
Nils
where, wait
Nils
My code: char *newstack = (char *)mmap(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0); if (newstack == MAP_FAILED) { return EXIT_FAILURE; } int res = clone(CLONE_FILES | CLONE_FS | CLONE_IO | CLONE_PTRACE | CLONE_VM, newstack, NULL, NULL, 0);
Nils
Are you sure you got clone() args right?
Yeah I am using the low level system call instead of libc
Vlad
Yeah I am using the low level system call instead of libc
I mean those two NULL's should be there?
Vlad
Maybe you should pass some pid's or smth
Nils
Nils
But I don't need the TIDs
Nils
Because I am not going to touch the thread as soon as it runs
Vlad
Yes, these are just for TIDs
Well you never know whether the callee would check for null or not.
Vlad
I just hope so
Don't hope. Read docs :P. Or test for a desperate measure.
Nils
Don't hope. Read docs :P. Or test for a desperate measure.
There are no docs about the low level function
Anonymous
There are no docs about the low level function
Well, there is probably second section of system man pages for that if you on Unix like system
Nils
Yeah
Was just curious, but it won't get further this
Anonymous
Could anyone assist me how to find greater numbers & equal to all possibilities for 4 variables by using conditional operator without using logic gates?
Dmitr
Hi can anyone help me? I made server + host for simple chat in rad studio with clientsocket and serversocket components but i feel it work not properly.. Now I even thinking to move to visual studio to find more examples. Can someone share good simple example of handling multiple clients in chat? Becouse my main problem i think in what i dont understand why client makes too many connections to server, i think it should be only one..
Dmitr
Can you send your clients code?
Yes, but it look very bad.. My clients are simply have host and port set, then I make them active, and on timer check if socket not active then i activate it, errors suppressed becouse idk what to do with them, indy documentation is hard
Dmitr
Eventually they do connect, but leave some connections alive maybe...
Dmitr
Plz dont bun me I just learn more from examples, which is hard to find on this subject
Ammar
size_t stack_siz = 1024 * 1024 * 8; char *newstack = (char *)mmap( NULL, stack_siz, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0); newstack += stack_siz - sizeof(void **); *((void **)newstack) = (void *)thefunc; int res = _clone(CLONE_FILES | CLONE_FS | CLONE_IO | CLONE_PTRACE | CLONE_VM, newstack, NULL, NULL, 0); sleep(100);
Ammar
The spawned thread will return to thefunc (this will be the return address of your thread).
Ammar
Also notice that, stack grows from higher memory to lower memory (VM_GROWSDOWN). So we need put the highest memory as thread stack, since the thread stack will grow down (notice the newstack increment before clone syscall).
Anonymous
M.Khorram
posting a picture... You should get warn
Anonymous
posting a picture... You should get warn
Show me the rule I should be warned for
Hadaward 'Solly'
"Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed". "hey, that's not a picture of code" please dont play dumb.
Talula
I hated this movie, the guy didn't even act like Steve Jobs, loved "Jobs" movie... Aston Kosher looks, talked, walked and everything like Steve Jobs.
M.Khorram
Show me the rule I should be warned for
yeah, you are right "* Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed." And based on this "unreasonable rule", sending such pictures are allowed. (sadly, people get banned for what you decided to set as rule)
Hadaward 'Solly'
look, buddy. This group goes way easier on rules, but he still has the point. "Should". Dont be so hurt because some stranger on internet pointed something reasonable. Maybe a bit too obvious? Yes. But still rules.
Hadaward 'Solly'
Also * A little bit of programming related memes, jokes, shitposting are allowed.
accepted. The last other "picture" was hours ago.
Anonymous
accepted. The last other "picture" was hours ago.
I don't actually understand what you're talking about
Anonymous
can we develop a game using c programming "DINASOUR game"? any answer's?
Anonymous
ok got it @Danya
ברני
Hey, can I ask here a simple c question that I'm struggling with mathematcly?
Engineer
https://blog.0x972.info/?d=2014/11/13/10/40/50-how-does-a-debugger-work
Engineer
Hey, can I ask here a simple c question that I'm struggling with mathematcly?
Let's give it a go. I told the people here about mathematics to the people here last weekend - it was funny.
Tekipeps
Hello please I need some opinions on how long it can take me to be pro in c++ if I practice at least 2hrs a day
ברני
Let's give it a go. I told the people here about mathematics to the people here last weekend - it was funny.
I didn't understand the calculation that making to show how many equal numbers...
Engineer
I didn't understand the calculation that making to show how many equal numbers...
Copy the code to here https://www.onlinegdb.com/online_c_compiler
Engineer
And click the share link
ברני
Online C Compiler https://www.programiz.com/c-programming/online-compiler/
ברני
Lol it didn't send with the code
Engineer
ברני
https://pastebin.pl/view/52a0ab8c
ברני
What exactly are you wanting to do count some things?
I didn't understand how mathematcly everything is happening... I understand what everything dose but not logecly with the order
ברני
Modolo by 10 for the right digit and then if %2 ==0 for the equals
ברני
My struggles are line 14-17
ברני
Oh sorry, so no lol.. The math logic is what confuse me
ברני
OK, but why do I calculate this in that specific order: evenDigitNum += evenDigitNumPos * digit; evenDigitNumPos *= 10; evenDigitCount++
ברני
I didn't understand the multiples 😥
Harsh
OK, but why do I calculate this in that specific order: evenDigitNum += evenDigitNumPos * digit; evenDigitNumPos *= 10; evenDigitCount++
You are counting even digit nums and making a number which has only even digits as individual numbers Like if a number is 1234 You'll have 42 as even even digit number
ברני
You are counting even digit nums and making a number which has only even digits as individual numbers Like if a number is 1234 You'll have 42 as even even digit number
Yes, I understand what the code is doing.. I just missing the math logic behind that.. It's hard for me to write the math in the code Cuz I'm always cunfuse what to do
ברני
Yes I'll translate it, one sec
ברני
Do you have an exact question which is being solved by the code?
Write a program that picks up a number from the user and prints the amount of even digits. For example for the number 16537 the program will print 1, because only the digit 6 is even. emphasis: ⦁ Check various inputs including end cases such as: single number, 0 and negative number.