Programming :: Alloc_task_struct() Function Allocates 8 KB Task_union Memory Areas?
Dec 30, 2010
alloc_task_struct( ) This function allocates 8 KB task_union memory areas. The function takes memoryareas from the cacheif it is at least half-full or if there isn't a free pair of consecutive page frames available.
View 3 Replies
ADVERTISEMENT
Jul 27, 2011
clarrify the below points:1) Where does the Kmalloc/Vmalloc/get_free_pages/malloc Allocates memory in which space is it Kernel/User?2) Coming to Hardware Point of View is where Kernel/User Space Memory Allocates is it in RAM or any.?3) In Device Drivers, how Open Call get to know whether the hardware is connected/not?
View 6 Replies
View Related
Apr 19, 2010
I am writing a game in C with SDL. I can successfully display one image on the screen and animate it. However, I am having a lot of issues getting the background to display using the same method. I was asking for help on SDL related forums, but I determined that the issue is not SDL related, and it is actually a pointer issue. However, I can't find where I'm going wrong.
Code:
#include <SDL/SDL.h>
struct image
[code]...
View 4 Replies
View Related
Jul 2, 2011
I am writing a function(in C language in Linux) to initialize an array of a structure from a mysql table by calling a function by reference but I have a problem with call this function by reference . this is my program:PHP Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
[code]...
View 4 Replies
View Related
Jul 19, 2011
I wrote a test program for learning usage of realloc() and I thin I did everything right but I get this error exactly with my 4th time that while tries to reallocate memory in MakeDSt function for DSt->SArray:
Quote:
realloc(): invalid next size
this is my complete code :
Code:
#include <stdio.h>
#include <stdlib.h>
typedef struct DRA
{
code....
View 2 Replies
View Related
Sep 22, 2010
I'm relatively young and equally ignorant as to C or C++ (or any other language for that matter). I've started learning C, but come across a view that C is getting old/obsolete, etc. and If someone just starts out they should start with C++.
I know that most of the linux kernel is written in C and so are a lot of linux tools. Are there any other areas where C still prevails?The reason I'm asking is that I'm now not sure which one to learn. I know that you'll answer: depends what you want to do. The problem is that I don't really know what one can do with C, as opposed to C++.
View 14 Replies
View Related
Nov 16, 2010
Code:
#include <iostream>
using namespace std;
[code]...
View 1 Replies
View Related
May 18, 2010
I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.
View 2 Replies
View Related
Mar 21, 2011
I am new to C and linux. My code below does arbitary writes but I cant figure out where or how it does it.
I am calling the insertNode() function with seq = 'MISSISSPPI$' and alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ$'
Code:
Weird behaviour I should mention is that when I check for NULL pointer in node->child[index], the unassigned values are not null anymore, they point to arbitary memory.
View 12 Replies
View Related
Apr 13, 2010
How do I write a script for my Linux that can show me total memory vs used memory and have it email me results if it's over 70 percent?
View 2 Replies
View Related
May 24, 2010
I want to declare a function in a function, but had no success till now, see the error code below and visit the project at sourceforge
[Code]...
View 14 Replies
View Related
Jun 20, 2010
I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.
#!/bin/bash
addelementtoarray()
{
local arrayname=$1
[code]....
View 10 Replies
View Related
Aug 25, 2010
Is that possible that SHM shared memory is counted as cache memory on Linux with kernel 2.6.18?If find it really odd since this memory is not file backed, but I have a piece of code that loads data using shm_open+mmap, and it generates an amount of cache memory in /proc/meminfo that corresponds exactly to the amount of shared memory (I load that data from a file but I am using posix_fadvise(fd,0,0,POSIX_FADV_DONTNEED) to ensure this file is not cached and I made sure that it is working as expected). As far as I know SHM memory was not tagged as cache memory with kernel 2.6.9.If it is the case it is really unfortunate since normally cache memory can be considered to be part of the "available" memory since it can be flushed promptly but this is clearly not the case with SHM memory... Is there an easy way to get the total amount of used SHM memory on a system?
View 4 Replies
View Related
Aug 1, 2011
In the terminal, what command can I use to find out the current ip address that my ISP allocates to me from their server to my router?
View 2 Replies
View Related
Sep 16, 2010
fit a surface i.e. W(x,y) using svdfit() provided by "Numerical Recipes in C". svdfit() is written for curve fitting and not for surface fitting.But one can use svdfit(), as claimed by authors of NR book, to do surface fitting. On page 680 of NR book, authors have given a hint on how to use svdfit() for fitting a surface. But I have not understood it.This link may be helpful (Chapter 15 th is relevant here.):[URL]This is my problem:
Code:
I have a set of 100 numbers. I want to fit a 2-Dimensional function W(x,y) to these numbers.
[code]....
View 2 Replies
View Related
Jan 1, 2011
I have a flash memory stick which according to GParted is "unallocated". As such it does not appear in File Browser or Gnome terminal. How can I get it to function? I don't mind formatting it but it is not showing. GParted will not let me change anything.
View 2 Replies
View Related
Jun 4, 2010
I have a question about calling an asm function from C....It doesn't work unless I create an asm variable to hold the value of the function in....Why?Here's the code that doesn't work...
asmfile.s - version one Code: .section .data
mydata: .ascii "this is the message!
.equ mylen, . - mydata
[code]...
View 2 Replies
View Related
Jul 23, 2010
I want to use backtrace() function to debug a crash issue. I tried this sample code to see how backtrace works. backtrace() function always returns 0 with the below code. Is there any kernel configuration that needs to be set for proper working of backtrace?
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
/* Obtain a backtrace and print it to stdout. */
void
print_trace (void)
[Code]...
View 2 Replies
View Related
May 30, 2010
Can you offer me the code about fmod() in C. I want to know how this function work, i am very interested in it because i have no idea to implement it, i want to know... how to write the function... not 'how to use the function' can anyone post the source codes of this function here?
View 6 Replies
View Related
Jul 5, 2010
i have an open source application that was developed in C++ (it uses objects and namespaces all over the place). I also have another application that was developed in C. Now i am trying to insert the code made in C into C++ application, but when i do that , i get this error on compilation of the source code:
Code:
error: 'mpi_init_vars' was not declared in this scope the function mpi_init_vars() is not part of object oriented programming and it doesn't belong to any scope, it was compiled into an object file and i am linking it with all objects of C++ application.
How can invoke the C function from C++ object oriented code?
View 2 Replies
View Related
May 2, 2011
I am trying to build a function inside a script.
Code:
#!/bin/sh
#System commands and other configurable.
IPT=/sbin/iptables
IP6T=/sbin/ip6tables
IPST=/usr/sbin/ipset
MODP=/sbin/modprobe
GET=/usr/bin/wget
INT_NET=192.168.1.0/24 .....
I can find lots of tutorials in how to use if, then, else. However, how do I define a variable inside the function?
SEE>>
Code:
for c in $ISO
Also, am I using the 'test' command correctly( -/+ week as valid test)?
View 7 Replies
View Related
Feb 7, 2011
I am doing a web site program and what I need is to call a C program in the PHP cloud.Do u think it would be possible? The web site would get the user input from PHP UI and pass to the C program , the C program would process the function with the user input and output the a PHP page.
View 2 Replies
View Related
Jan 4, 2011
I ask if a c++/c function is able to know its name from inside itself:
example:
Code:
int funct1(int a,b)
{
printf("%s ",funct_name());
}
or with a trick.
View 2 Replies
View Related
May 30, 2010
Code:
#!/bin/ksh
(...)
# FILL UP PARTITION
diskfillerfunction () {
[Code]....
Test 15: fill up partition /usr/bin/time: cannot run diskfillerfunction: No such file or directory
I am obviously omitting (...) a lot of the code, but the relevant part is all there. How do I 'time' a function?
View 5 Replies
View Related
Mar 26, 2010
I wrote a spinner in Perl and when I did a spinner in shell I could just run the subroutine in the background.
[code]...
In Perl, how do you run a function in a background and get the PID for that? I know PID in Perl is $$
View 2 Replies
View Related
Mar 25, 2011
I know what is the functionality of the sleep() method.
for(i = 0; i < length; i++){
sleep(1000);
printf("%c
", message[i]);
}
Result :every print of the message will be takes 1000sec of gap but i want to know why wee need to use the Sleep function. where exactly it is useful
View 14 Replies
View Related
Nov 15, 2010
On this link [URL]4 a return type is defined
Code:
return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG);
What is the above function returning.I am not clear with definition of what is being returned in the above code.
View 7 Replies
View Related
Apr 8, 2010
i want to compile function c in java and compile library is success.. when i call the library in java and error is :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no libfunc.so in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1689)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
[Code]....
View 1 Replies
View Related
Apr 13, 2010
In shell, I execute "./ffmpeg -f h264 - | xxx"
Now I hope use execl function to execute above operations,
I call execl("/bin/sh", "sh", "-c", "./ffmpeg -f h264 - | xxx");
but ffmpeg doesn't work, it seems that "|" pipe don't work.
how could I solve this?
View 1 Replies
View Related
May 22, 2010
I wrote some code in c, using pthread (I configured the linker and compiler in eclipse IDE first).
Code: #include <pthread.h>
#include "starter.h"
#include "UI.h"
Page* MM;
[Code]....
View 6 Replies
View Related