Programming :: Forcing Atomicity In User Code (C++)

Jun 29, 2010

It there a way in linux to force atomicity of user code sections on a multi-core x86 chip?

I know in classes I have taken we disable/enable interrupts, but I don't think that works on a CMP.

Basically, I want to stop the kernel from being able to switch off my process for some period of time.

View 5 Replies


ADVERTISEMENT

Programming :: Call Socket Prog Code Written In User Space From Kernel Space?

Jul 14, 2009

How to use execv from kernel space to call a user space program writtenfor socket prog.

I tried to write code for socket in kernel but its not working.

Socket code in kernel is also needed.

View 2 Replies View Related

Programming :: Selenium Java Code Into Equivalent Php Code?

Mar 30, 2011

I need to rewrite the selenium java code into its equivalent php code.

View 5 Replies View Related

General :: Security Dangers Of Executing Malignant Code As A Standard User?

Jan 28, 2011

Slipping some (non-root) user a piece of malignant code that he or she executes might be considered as one of the highest security breaches possible. (The only higher I can see is actually accessing the root user) What can an attacker effectively do when he/she gets a standard, (let's say a normal Ubuntu user) to execute code? Where would an attacker go from there? What would that piece of code do?

Let's say that the user is not stupid enough to be lured into entering the root/sudo password into a form/program she doesn't know. Only software from trusted sources is installed. The way I see it there is not really much one could do, is there?

Addition: I partially ask this because I am thinking of granting some people shell (non-root) access to my server. They should be able to have normal access to programs. I want them to be able to compile programs with gcc. So there will definitely be arbitrary code run in user-space...

View 2 Replies View Related

Programming :: Use SSE(2,3) In C/C++ Code?

Jun 6, 2011

I am working on a project with a lot of vector math and I'd like to find a way to speed it up.eading about SSE, but I've found no explanation on how to actually use it in code (was looking for some kind of hello-world example, complete with compilation instructions).Does the gcc compiler automatically make use of SSE, if you add the -sse(2,3) option on the command line? Or are their specific functions/libraries you need to call?

View 12 Replies View Related

Programming :: Code That Will Never Execute

May 23, 2011

Is there, by chance, a fancy name to describe code that must be in a program but will never be executed? In one of my (Haskell) programs, I have some error-handling code that must be in the program to keep the compiler happy (due to the type checking). However I know that, due to the logical structure of the program, it is impossible for the code to be evaluated. I am curious if there is a technical name given to code that must exist but cannot be executed.

View 6 Replies View Related

Programming :: GLX Code Won't Run Anymore?

Jan 14, 2011

I went to compile some "oldish" glx code. The code compiles great but when I go to run it I get a crash. With X Error of failed request: BadMatch (in .....running ddd causes my whole system to lock up when I call the glx function XOpenDisplay. After a few attempts I thought I'd download a demo from the net, I choose nehe opengl tutorial 2, I compiled and ran but even on a net tutorial I get the same error

./lesson02
XF86VidModeExtension-Version 2.2
Got Doublebuffered Visual!

[code]....

View 1 Replies View Related

Programming :: Translating Code To OSX?

Jul 20, 2011

I have the following code:

Code:
#!/bin/bash
function dx {

[Code].....

So essentially, it finds dx files, sorts them by numbers at the beginning, then performs the dx function I made (loops over all of the #-protein.dx and #-water.dx files).

It works fine when I'm running it on Ubuntu 11.04. However, when I try to run it on OSX, I get the following error:

Code:
mh320m01:DA_R02 janickij$ ./MOD_Loop_Tuber_Script.sh
find: illegal option -- t
find: illegal option -- y

[Code]....

View 9 Replies View Related

Programming :: How To Share Code With Others

Jan 5, 2010

I work as a linux sysadmin, and are now and then developing scripts that might be of use for others. I'd like to be able to share these, and for less trivial projects maybe create a central repository or something that others may upload updates/patches to etc.

View 10 Replies View Related

Programming :: How To Combine ASM And C Code

Apr 10, 2010

I have a little test program consisting of a NASM source file and a C source file.How do I turn them into a single program?

Code:
section .data
msg db 'Hello, World!', 10

[code]....

View 14 Replies View Related

Programming :: Three Lines Of Code - What Do They Actually Mean

Feb 23, 2011

whichever source code I go through I find these three lines of code written what do they actually mean and what is their function?

[code]...

View 6 Replies View Related

Programming :: How To Use Bash Variable In C Code?

Feb 16, 2011

I want to write a c program with some shell scripts.Now For a simple C program. I am Setting a variable called val2 in bash, now I want to use bash variable val2 in C code. How do I do that?The above doesn't work (coz its spawning a different memory space and when shell script ends the variable dies with it as per my research but how do I keep them in same memory space)Also Is there any Good reference where they teach how to integrate C and Bash Together?

View 5 Replies View Related

Programming :: Alternative For Code: Wc -l Using Grep?

Mar 23, 2011

Can you find an alternative for Code: wc -l using grep?

View 1 Replies View Related

Programming :: Code To Add 5 Numbers In Assembly?

Mar 28, 2011

Looking for code to add 5 numbers in assembly? I want to use array for input of those 5 numbers. No problem if the output is 1 digit(0....9).

View 3 Replies View Related

Programming :: Converting C Code To Assembly

May 17, 2011

I've been converting some C code to assembly for my homework; it was going well but I'm having trouble with a for loop for hours. I could not understand where is the problem and decided to ask. I'm posting the part where I'm having trouble of my C-code and assembly-code; every other part of codes act same and the variable values are same. I'm waiting this two codes to act same, but they don't.

Code:
mov ebx, [result]
mov eax, [i]
mov ecx, [ebx+eax]
mov [j], ecx
mov [ebx+eax], byte '.'

_loop:
mov ebx, [result]
mov eax, [i]
inc eax
mov cl, [ebx+eax]
cmp cl, 'Z'
je _continue

mov ebx,[result]
mov eax,[i]
inc eax
mov ecx, [ebx+eax]
mov [k], ecx
mov ebx, [result]
mov eax, [i]
inc eax
mov ecx, [j]
mov [ebx+eax], ecx
mov ecx, [k]
mov [j], ecx
inc dword [i]
jmp _loop

_continue:
Code:
j=result[i];
result[i]='.';
for(;result[i+1]!='Z';i++){
k=result[i+1];
result[i+1]=j;
j=k;
}

View 10 Replies View Related

Programming :: C Code Not Running As Expected / Cause Of It?

Apr 27, 2010

I was wondering why this code only returns me the same value ten times instead of valuate the conta+0.1 value code...

View 6 Replies View Related

Programming :: Error In Graphics - Run Code

Jan 2, 2011

i want to run this code

[code]...

i have error in graphics. i have C++ 2005

View 4 Replies View Related

Programming :: Calling Fortran 95 Code In C?

Apr 15, 2009

I'm trying to call some Fortran 95 code in C, but I'm having problems with integers not having the same value in C as in Fortran, and changing values upon each run of the program. I think it has to do with the integer type, but I don't know how to fix it. I'm running Gentoo x86. Here are the files I've got:

foo.c:

Code:

#include <stdio.h>
extern int qux_();
main() {

[code]....

View 2 Replies View Related

Programming :: Cannot Compile C++ Code In Terminal

Feb 13, 2011

I am unable to compile C++ program in terminal. Whenever I try to add "#include<iostream.h>" it shows an error and thats why I can not use "cout" and "cin" functions. I installed g++ for this but the problem persists.

View 4 Replies View Related

Programming :: Cannot Open .dbf File Via A Code ?

Jun 12, 2011

I created a dbf file via a code but the file does'nt seems to open.

Quote:

Code is running file and the file emaster.dbf and etran.dbftoo is created in the home directory but it does'nt opens(Libre Office 3 can't open it).

How to open the file.? I want to add information to the database file(Dbf) file. But until it opens how will I achieve my purpose?

View 3 Replies View Related

Programming :: Can't Compile F77 Code Using Gfortran Or G77

Nov 17, 2009

I have legacy fortran 77 code that used to compile seamlessly using g77 on an old machine. I've tried to recompile it on a new machine (old one is dead) using the original makefile, but the linker fails under g77, while there are persisting syntax errors using gfortran. I have two source files readmixed.f and subroutines.f. Under g77 the object files are produced using

Quote:

$ f77 -c readmixed.f -o readmixed.o
$ f77 -c subroutines.f -o subroutines.o

but the linking fails with

Quote:

$ f77 readmixed.o subroutines.o -o readmixed
subroutines.o(.text+0x0): In function `norm1_':
: multiple definition of `norm1_'
readmixed.o(.text+0x3987): first defined here

[code].....

View 2 Replies View Related

Programming :: Code For Few Warning Messages?

Oct 2, 2010

For the following compilation warning message I need to create some sample program in C for self study. Also I am looking for some good web link where all the C warnings are described.

1. Warning #47: incompatible redefinition of macro "entity" . Undefine macro before
2. Warning #167: argument of type is incompatible with parameter of type
3. Warning #175: subscript out of range

[code]....

View 1 Replies View Related

Programming :: Code For Generating A Pop-Up Window In C

Aug 4, 2010

Unfortunatelly since i have no background at all about GUI programming, i dont know even the keyword for that i want to generate a pop up window from my program (written in C) which show a message and an OK button. in my opinion, maybe i should use directly the Xlib library and not the GTK or QT library for example so the program can work almost on every linux system. A code snippet/hint for the pop-up window then?

View 2 Replies View Related

Programming :: Execute Code For N Time?

Apr 23, 2011

I'm doing a program and I want it to execute some code during n seconds. For example e put a command in the shell like this 'ls % 10' and the program should run the command ls for 10 seconds.I'm trying something like this:

Code:
pid = fork();
if(pid == 0) {

[code]....

View 2 Replies View Related

Programming :: Git - Getting On The Same Code Level - Github

Dec 1, 2010

I first created a fork on github from an existing git repo. Then I made changes to my fork and pushed them to github again. After that the person from who I forked included my changes in his code but made some alterations on it. What I want to do know is having the exact code he has in the repo. This way I am sure that I actually develop on the same code.

I wonder how I should do this. I tried using git mergetool but I had some conflicts. So if I resolve the conflicts and make some mistake here, then I still wouldn't have the code the original repo(the repo where I forked from) has. what is the correct way to do this?

View 2 Replies View Related

Programming :: How C++ Code Can Be Exploited In Tcl Script

Apr 12, 2010

I'm using ns2.31 on fedora 12, I'm wondeing how can I exploit a c++ code with a tcl script?

View 1 Replies View Related

Programming :: Write Code To Video From The Net?

Jan 7, 2010

I have source code that plays video stream, and can open a remote video file if provided with a URL. But I have a problem getting video from ...... the URLs I get look like:

[URL]

and my code expects something like [URL] I need to modify the code, such that it will find the actual file.

View 1 Replies View Related

Programming :: Make Compiles C++ Code?

Aug 8, 2010

I'm developing a new command to be executed on the grub shell. However for some reason the .c file I added doesn't get compiled. How do I notify make of this new file?When you type in the make command, a load of gcc commands come up, where do these come from?

gcc -Ikern -I./kern -I. -I./include -I./gnulib -I./include -Wall -W -DGRUB_LIBDIR="/usr/local/lib/`echo grub/i386-pc | sed 's,x,x,'`" -DLOCALEDIR="" -DGRUB_MACHINE_PCBIOS=1 -DGRUB_UTIL=1 -MD -c -o grub_setup-kern_file.o kern/file.c

I know this because I typed in random letters but the compiler continued on. However tried it on an existing file it came up with a compile time error.

View 3 Replies View Related

Programming :: Change MAC Address Via C Code?

Apr 12, 2010

I need a way to change the machine MAC address via a C code in linux. Ive find a way to retrieve it but not to change it.

View 4 Replies View Related

Programming :: Compile (gcc) Using Code From Other Projects?

Jan 16, 2010

I'm trying to write a helper for the mount utility (mount.truecrypt) and there are some things in the util-linux-ng package that would be helpful. For example, in fstab.c, there is a lock_mtab() function. I want to be able to do something like:

Code:

#include "fstab.h"
int main(int argc, char *argv[])
{
lock_mtab();

[code]....

But I don't know how to compile it. I was trying (naively) something like:

Code:

$ gcc mount.truecrypt.c fstab.c -o mount.truecrypt

But I guess the problem is fstab needs a whole bunch of other stuff. Should I just build the entire util-linux-ng package and then use the output somehow? If anyone is interested in mount.truecrypt (to be compatible with mount and /etc/fstab) you might be interested in giving me a little bit of guidance. I've got enough code to build the actual truecrypt command thus far. In fact, it's useable, but not robust (ie, doesn't lock the mtab, etc). You can browse the source for util-linux-ng here: [URL] and download a tagged release here:[URL]

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved