Skip to content
Advertisement

Tag: c++

Why I get a 500 only on kestrel?

I got a ASP.NET Core 2.0 WEB-API and it should work on kestrel because it will be hostet there. When I start with Kestrel (look at my launchSettings below) there is a POST and I always get a 500 returning without going into the code. Means I leave breackpoints everywhere and when I execute the POST in Swagger no breakpoint

c++ close a open() file read with mmap

I am working with mmap() to fastly read big files, basing my script on this question answer (Fast textfile reading in c++). I am using the second version from sehe answer : and it works just great. But if I implement it over a loop of several files (I just change the main() function name to: and then get the

clangd on linux cannot find default headers

I’ve installed the newest LLVM toolchain from the official PPA, including clang, clang-tools-extra, lldb, lld, libc++ and libc++abi. I’m trying to use clangd with emacs + lsp. All works fine except clangd cannot find default headers like memory, vector and so on. My code is fine, it is normally compiled using clang. My compile_commands.json also okay. How to make clangd

Where is ssize_t defined in Linux?

OS: Debian 9 (Linux 4.9) Compiler: GCC 8.2 Currently I am including <stddef.h> (where size_t is defined) and <stdint.h> (where most integral types are defined), but I still don’t have ssize_t. Where is it defined? Answer ssize_t is defined in sys/types.h. Per the POSIX documentation: NAME sys/types.h – data types SYNOPSIS DESCRIPTION The header shall define at least the following

Creating a new file from a cpp program in Ubuntu [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago. Improve this question How do I create a new file from a cpp program in Ubuntu, and is it any different from windows. Answer Declare a stream class

Resubmitting DMA Engine transactions

I’m writing a custom high-speed Linux SPI driver for an embedded SoC. To send data to the SPI peripheral (DMA_MEM_TO_DEV) I’m the Linux DMA Engine API. https://www.kernel.org/doc/Documentation/dmaengine/client.txt Based on the documentation, the steps for setting up and executing a DMA transaction are: Allocate a DMA slave channel : dma_request_channel Set slave and controller specific parameters : dmaengine_slave_config Get a descriptor

How to get fully interactive bash terminal in C with shift + ctrl keys?

I want to know how to create a fully interactive terminal. I am creating an interactive bash terminal like this: I can then go on to use read()/write() to send commands and receive output. My problem is how do I automate CTRL & SHIFT keys? Python’s subprocess does this so it’s definitely possible. How to send ctrl-c to kill foreground

getline() is repeatedly reading the file, when fork() is used

I am developing a simple shell program, a command line interpreter and I wanted to read input from the file line by line, so I used getline() function. At the first time, the program works correctly, however, when it reaches the end of the file, instead of terminating, it starts to read a file from the start and it runs

Advertisement