Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8758669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:36:25+00:00 2026-06-13T14:36:25+00:00

Is there a max size for a char buffer? I have a program that

  • 0

Is there a max size for a char buffer? I have a program that is collecting strings for a char buffer and writing it to a proc file. After a certain point it appears to stop writing things – is there too much in there? What is that max size so I can work around this?

Here is code. This is an LKM – is limits.h available from kernel space?

Foremost:

const char* input = "hooloo\n";

Next:

int read_info( char *page, char **start, off_t off, int count, int *eof, void *data )
{

    unsigned int mem;
    char answer_buf[strlen(input) + 1 + 14];
    name_added = vmalloc(strlen(input) + 1 + 14);
    strcpy(name_added, input);
    strcat(name_added, extension);
    mem = sprintf(answer_buf, "%s\n", name_added);
    memcpy(page, answer_buf, mem);
    return strlen(answer_buf) + 1;
}

All in my code are things like this are things that remalloc the buffer and add to it. Also, that read_info is for the procfile. This issue is I keep adding to that buffer with the code above over and over and over – eventually I ca my procfile and the text cuts off – it doesn’t go on forever like i want )-=.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:36:26+00:00Added an answer on June 13, 2026 at 2:36 pm

    There’s no concrete maximum size “in C” specifically. Theoretical (or “potential”) maximum size of any object on a C platform is determined by the implementation and is usually derived from the properties of the underlying machine platform and OS.

    On platforms with flat memory model it will typically be limited by the size of the address space in theory, and by the size of the available free memory (or that specific kind) in practice.

    On platforms with segmented memory model it might be limited by the segment size, which is smaller than the address space size. Although implementations are free to breach that limit by “emulating” flat memory model in the code. For that reason on such platforms the maximum object size can also depend on compilation settings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A Java char is 2 bytes (max size of 65,536) but there are 95,221
In connection string to SQL Server there is max pool size option. My question
Is there a 'Max # of result sets that can be displayed' when executing
Is there any plugin for jQuery that would take an argument for the max
gcc 4.4.4 c89 I have a program that I am testing. I create a
I have a program that generates a single random character, using the randomCharacter function,
I have the following function: void writeResults(FILE* fp, FILE* fpw, Vector w, int size)
Is there a way to compute efficiently the Fourier transform of the max of
I wonder if there is better way to get max from column c1 and
Is there a way to find out the number of digits of min/max values

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.