proc

How to make Pro*C cope with #warning directives?

When I try to precompile a *.pc file that contains a #warning directive I recieve the following error: PCC-S-02014, Encountered the symbol "warning" when expecting one of the followin g: (bla bla bla). Can I somehow convince Pro*C to ignore the thing if it doesn't know what to do with it? I can't remove the #warning directive as it's u...

How do I marshall a lambda (Proc) in Ruby?

Joe Van Dyk asked the Ruby mailing list: Hi, In Ruby, I guess you can't marshal a lambda/proc object, right? Is that possible in lisp or other languages? What I was trying to do: l = lamda { ... } Bj.submit "/path/to/ruby/program", :stdin => Marshal.dump(l) So, I'm sending BackgroundJob a lambda object, which cont...

Unix Proc Directory

I am trying to find the virtual file that contains the current users id. I was told that I could find it in the proc directory, but not quite sure which file. ...

What makes a pthread defunct ?

i'm working with a multi-threaded program (using pthreads) that currently create a background thread (PTHREAD_DETACHED) and then invokes pthread_exit(0). My problem is that the process is then listed as "defunct" and curiously do not seems to "really exists" in /proc (which defeats my debugging strategies) I would like the following req...

How do you stringize/serialize Ruby code?

I want to be able to write a lambda/Proc in my Ruby code, serialize it so that I can write it to disk, and then execute the lambda later. Sort of like... x = 40 f = lambda { |y| x + y } save_for_later(f) Later, in a separate run of the Ruby interpreter, I want to be able to say... f = load_from_before z = f.call(2) z.should == 42 ...

Will Pro*C work with MSVC 6?

How do you get Pro*c to work within MSVC 6? In otherwords compile a .pc file into a .cpp file. ...

Linux kernel /proc FIFO/pipe

I'm currently trying to create a kernel module that will produce data based on kernel events and push them to a file. After reading that this is bad (and I agree), I decided it would make more sense to have the data in a /proc file that a user program could pull from when necessary. However, this idea led to all sorts of problems, part...

ORACLE 10.2 Pro*C precompiler not reading header file

I'm pre-compiling a C program containing Pro*C code with ORACLE 10.2 and AIX 5.2 The ORACLE precompiler reads the $ORACLE_HOME/precomp/admin/pcscfg.cfg file which contains the definition of the sys_include variable (set to /usr/include) The Pro*C compiler complains that it doesn't know what the size_t type is and the ORACLE header file...

How to keep implementation/maintenance costs low in Pro*C?

Having experienced the horror that is Oracle Pro*C, when dealing with dynamically specified columns, and the need for bulk operations (ANSI METHOD 4), I simply must ask: What Ideas/Techniques can you share which makes it easier to develop/test/debug/maintain C and C++ CRUD applications which use Pro*C or Pro*C++? I am specifically int...

Are there any tools that are able to do cyclomatics on Pro*C++ sources?

Are there any tools that are able to do code metrics on Pro*C++ sources? I haven't been able to find anything specific via Google. Does anyone have any experience with this? Thanks. ...

Oracle ProC ORA-12547

I'm working on re-compiling some proC code that no one currently at my company has ever compiled. . . It's compiling OK, but when I copy it to the production server and run it I'm getting Oracle error ORA-12547 (TNS: lost contact) Any ideas? ...

Informix to Oracle: Dealing with Fetching Null Values

A bit of background first. My company is evaluating whether or not we will migrate our Informix database to Oracle 10g. We have several ESQL/C programs. I've run some through the Oracle Migration workbench and have been muddling through some testing. Now I've come to realize a few things. First, we have dynamic sql statements that are n...

What would be the simplest way to interface custom hardware with one input to have switch somewhere in /proc?

I have a device that takes low current 3-12v input signal to do it's magic and I would like to interface it to my linux box. What kind of options do I have on this? It would be great to have some low-cost possibly user-space solution. ...

parsing proc/pid/cmdline to get function parameters

Hello all, I'm trying to extract the parameter with which an app was called by using the data inside cmdline. If I start an application instance like this: myapp 1 2 and then cat the cmdline of myapp I will see something like myapp12. I needed to extract these values and I used this piece of code to do it pid_t proc_id = get...

Why does this code produce a nil following a Proc.call?

C:\>irb irb(main):001:0> s = Proc.new { puts "Hello" } => #<Proc:0x04051780@(irb):1> irb(main):002:0> s.call Hello => nil What causes the nil? ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] ...

ArgumentError calling a Proc

s = Proc.new {|x|x*2} puts s.call(5) -> 10 def foo(&a) a.call(5) end puts "test foo:" foo(s) When I try to call the proc above, I get: foo: wrong number of arguments (1 for 0) (ArgumentError) My expectation was that I can pass a proc to a method if the method is defined with this type of signature: def foo(&a) and then I can e...

How can two arguments be passed to a method with a one-argument signature?

s = Proc.new {|x|x*2} def one_arg(x) puts yield(x) end one_arg(5, &s) How does one_arg know about &s? ...

Why does explicit return make a difference in a Proc?

def foo f = Proc.new { return "return from foo from inside proc" } f.call # control leaves foo here return "return from foo" end def bar b = Proc.new { "return from bar from inside proc" } b.call # control leaves bar here return "return from bar" end puts foo # prints "return from foo from inside proc" puts bar # prints ...

Accessing the proc_dir_entry from proc_fops.open?

I writing a linux kernel module that does some work with /proc... I'm trying to use the new seq methods for returning the data for /proc... Anyhow, after I call proc_create_data() I have a proc_dir_entry (whose ->data member is pointing at my supplied context)... Anyhow, the file_operations structure is also passed and I really need to k...

thread level memory consumption of process

How do I get per thread based memory consumption of a process in Linux? I understand that we can use /proc/pid/task/tid/statm, but thats not helping my case. All the threads show same value and its same as PID's statm. We can do valgrind but I am not looking for any invalid read/write or leaks. Valgrind will not tell me any thread leve...